mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Compare commits
524
Commits
v4
...
decideaction
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b8c2d1ff9 | ||
|
|
caf925b216 | ||
|
|
bd9cbd9944 | ||
|
|
41945842d5 | ||
|
|
91a1059f87 | ||
|
|
9c0fb0b6da | ||
|
|
3d7d7cc88a | ||
|
|
737cd848ce | ||
|
|
1bead3a0fe | ||
|
|
b50ed93f39 | ||
|
|
75355f6cac | ||
|
|
2448ccb191 | ||
|
|
42215e7a51 | ||
|
|
1419cc6925 | ||
|
|
76af6b7641 | ||
|
|
2b1838dbb0 | ||
|
|
4ad34f80a9 | ||
|
|
ff96d653e2 | ||
|
|
58ea3be2fd | ||
|
|
4678cab16f | ||
|
|
1b9cb1f75e | ||
|
|
df8d4bd8a2 | ||
|
|
52a4959dfb | ||
|
|
e806fd37e7 | ||
|
|
cd054b549f | ||
|
|
c3f4ee754a | ||
|
|
a46d2dbb96 | ||
|
|
16fc2d8177 | ||
|
|
e634edd862 | ||
|
|
f5b705cbe4 | ||
|
|
4e19816b57 | ||
|
|
20dadec54c | ||
|
|
f3ce1d5ff9 | ||
|
|
b1c076416c | ||
|
|
cc984b09f6 | ||
|
|
8d00a316c5 | ||
|
|
d51f1e6088 | ||
|
|
1c86d96e9d | ||
|
|
1368962244 | ||
|
|
6f6aadf89c | ||
|
|
96de96e9c6 | ||
|
|
ebcc5449c5 | ||
|
|
6b7bc51a52 | ||
|
|
622cffce82 | ||
|
|
5ed79c3edb | ||
|
|
fe69dba958 | ||
|
|
f8b6ee1672 | ||
|
|
30070035cc | ||
|
|
ff3079ff23 | ||
|
|
aba3688b4b | ||
|
|
2e3e4b38d9 | ||
|
|
f075963bca | ||
|
|
d6b30c6f43 | ||
|
|
4fcf03d31a | ||
|
|
03edc532e1 | ||
|
|
1db41f4c36 | ||
|
|
96ede9299f | ||
|
|
b226f2a21d | ||
|
|
6629562b34 | ||
|
|
91d7620c0b | ||
|
|
c341402fe1 | ||
|
|
80b1af930a | ||
|
|
608eb8e4e6 | ||
|
|
ec1c6fc112 | ||
|
|
4fabab680f | ||
|
|
def815988b | ||
|
|
21df179941 | ||
|
|
ff674e79b9 | ||
|
|
9efa5e1108 | ||
|
|
c235345a22 | ||
|
|
97791bfcc3 | ||
|
|
d49185c291 | ||
|
|
41eba8ff3a | ||
|
|
2fd5e2c255 | ||
|
|
a83bb00d52 | ||
|
|
cb27d0cd72 | ||
|
|
020cd270c0 | ||
|
|
a6e1b93af0 | ||
|
|
5dd4043f00 | ||
|
|
61f8efaac0 | ||
|
|
3ee22bdb31 | ||
|
|
032ac8e566 | ||
|
|
1e78fc68bc | ||
|
|
a074dbf3ee | ||
|
|
9cfcfac376 | ||
|
|
fb8feca896 | ||
|
|
be70cd18a2 | ||
|
|
6a1b84e53b | ||
|
|
584e10d14f | ||
|
|
4f0f6f9f23 | ||
|
|
2f13ef79b6 | ||
|
|
f8f9c18cda | ||
|
|
37c081f3db | ||
|
|
e684f61f55 | ||
|
|
c2f4ca5da1 | ||
|
|
5befb47881 | ||
|
|
780831611d | ||
|
|
bb13225778 | ||
|
|
2f62d6fe44 | ||
|
|
6e94ac144b | ||
|
|
6e45ca9825 | ||
|
|
142de9b02e | ||
|
|
7a024aecd7 | ||
|
|
c81d290957 | ||
|
|
3c498abe82 | ||
|
|
fdf494c28a | ||
|
|
b903ead06a | ||
|
|
591a1a63c8 | ||
|
|
e60dcbc3e9 | ||
|
|
d73d56d85a | ||
|
|
d21293d4ad | ||
|
|
297d052670 | ||
|
|
f21508ad15 | ||
|
|
4c53bb70f3 | ||
|
|
6c5f94c0cc | ||
|
|
65e5c1768a | ||
|
|
04f03fb2cc | ||
|
|
a8218462e1 | ||
|
|
00c8bd0aa7 | ||
|
|
d3cd51e7eb | ||
|
|
37795bb73c | ||
|
|
5b4099a828 | ||
|
|
977b7a5b2d | ||
|
|
e6824bf15d | ||
|
|
63a58502d1 | ||
|
|
173f786f55 | ||
|
|
ea1a3a9e9e | ||
|
|
c1b8309753 | ||
|
|
d86dc39f9f | ||
|
|
b580459e57 | ||
|
|
b562b45c00 | ||
|
|
4a43b7704e | ||
|
|
4a813e567a | ||
|
|
ea4cea2231 | ||
|
|
f263c7270f | ||
|
|
4b38f56d1f | ||
|
|
9bf289561b | ||
|
|
10fa5f37d6 | ||
|
|
0d8873d2c0 | ||
|
|
f2b88ef080 | ||
|
|
1e6586f187 | ||
|
|
dbb1c0a929 | ||
|
|
91ae6e1223 | ||
|
|
04bf102614 | ||
|
|
677b320534 | ||
|
|
265a7c0af7 | ||
|
|
04b1937caa | ||
|
|
842009ab3f | ||
|
|
f27164b9dc | ||
|
|
20ee284e42 | ||
|
|
ec6401ee5d | ||
|
|
d8d3db89d2 | ||
|
|
af1ad3885f | ||
|
|
0199084f05 | ||
|
|
1db9af545c | ||
|
|
951a88e947 | ||
|
|
b6e276ac34 | ||
|
|
3a3b415cc5 | ||
|
|
d0b86e69d8 | ||
|
|
10f6a48f50 | ||
|
|
18dfda46f2 | ||
|
|
4e24a6b9ba | ||
|
|
3061237e58 | ||
|
|
d05e9ec916 | ||
|
|
8fe051dc8d | ||
|
|
9c9d6ebb4a | ||
|
|
8bda0aaaf3 | ||
|
|
fc824fb556 | ||
|
|
e3845520f8 | ||
|
|
fa8e3113fe | ||
|
|
62fbf90daa | ||
|
|
10ac8624fe | ||
|
|
4e60877add | ||
|
|
740a1a8851 | ||
|
|
55afb83eb2 | ||
|
|
dfd5cfd42e | ||
|
|
518f7959aa | ||
|
|
f4f1bb25b6 | ||
|
|
731f3a7d99 | ||
|
|
cf048f9629 | ||
|
|
34a369938b | ||
|
|
2979f49e8d | ||
|
|
0dc080b01d | ||
|
|
014b06641e | ||
|
|
56d4499262 | ||
|
|
92c58d9fb6 | ||
|
|
330470353c | ||
|
|
7c274fd87a | ||
|
|
5e28730c2a | ||
|
|
fccb2e15bd | ||
|
|
e354885b16 | ||
|
|
056fc5ea6e | ||
|
|
2c50518b61 | ||
|
|
803ee8d90b | ||
|
|
243e22a8c6 | ||
|
|
d85643b895 | ||
|
|
413eaa08fb | ||
|
|
08c82aa056 | ||
|
|
03e4898061 | ||
|
|
6799d68b3c | ||
|
|
5f6114fed9 | ||
|
|
eace375a3b | ||
|
|
419f9f3bf5 | ||
|
|
9e4b819f69 | ||
|
|
8296bfbf8a | ||
|
|
12250a34ae | ||
|
|
9f7b545528 | ||
|
|
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 | ||
|
|
de91c7a9fd | ||
|
|
ab2c5fc10d | ||
|
|
5fe730b075 | ||
|
|
57716e1c07 | ||
|
|
dfc17c68c6 | ||
|
|
67a26e0936 | ||
|
|
1a98420160 | ||
|
|
877ec385ee | ||
|
|
b480a67d36 | ||
|
|
adf86380ca | ||
|
|
93acd19c11 | ||
|
|
f6052f0eff | ||
|
|
eaf76957c0 | ||
|
|
3c2b048367 | ||
|
|
1aec54f59c | ||
|
|
0240729c11 | ||
|
|
5c86cf0b07 | ||
|
|
79372d5d23 | ||
|
|
4faccb2957 | ||
|
|
0ed68b6214 | ||
|
|
f646bc2bfa | ||
|
|
01327265a3 | ||
|
|
cd193c7f5e | ||
|
|
f249406ba0 | ||
|
|
7ee8165e02 | ||
|
|
caf5828153 | ||
|
|
ffb95a2418 | ||
|
|
22f2c9ff9a | ||
|
|
a90e11619d | ||
|
|
d6c9cb20b2 | ||
|
|
1586e8fd2b | ||
|
|
88af94eaaf | ||
|
|
6131ebc689 | ||
|
|
ae709f2d19 | ||
|
|
a45f3ae319 | ||
|
|
318e4a40cf | ||
|
|
1170f82159 | ||
|
|
d28ed97dff | ||
|
|
96a7fa0538 | ||
|
|
c5d1615035 | ||
|
|
138ad0656f | ||
|
|
a0cbe42a01 | ||
|
|
06478266d0 | ||
|
|
613de1b869 | ||
|
|
1c4929c3e1 | ||
|
|
664142c36c | ||
|
|
1c8d008a66 | ||
|
|
0e529070c4 | ||
|
|
bacad9b4c0 | ||
|
|
e502727828 | ||
|
|
d99b12cb5f | ||
|
|
070867d965 | ||
|
|
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=RelWithDebInfo -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;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "Cursors.h"
|
#include "Cursors.h"
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
|
|||||||
+24
-37
@@ -1,40 +1,27 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "FeaturesScreen.h"
|
#include "FeaturesScreen.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "SaveLoadScreen.h"
|
#include "SaveLoadScreen.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "WordWrap.h"
|
#include "WCheck.h"
|
||||||
#include "WCheck.h"
|
#include "Utilities.h"
|
||||||
#include "Utilities.h"
|
#include "Sound Control.h"
|
||||||
#include "DEBUG.H"
|
#include "Ambient Control.h"
|
||||||
#include "Sound Control.h"
|
#include "GameSettings.h"
|
||||||
#include "Ambient Control.h"
|
#include "Game Init.h"
|
||||||
#include "WorldDat.h"
|
#include "english.h"
|
||||||
#include "worlddef.h"
|
#include "Cursors.h"
|
||||||
#include "GameSettings.h"
|
#include "sysutil.h"
|
||||||
#include "Game Init.h"
|
#include "Text.h"
|
||||||
#include "english.h"
|
#include "Interface Control.h"
|
||||||
#include "Overhead.h"
|
#include "message.h"
|
||||||
#include "GAP.H"
|
#include "Multi Language Graphic Utils.h"
|
||||||
#include "Cursors.h"
|
#include "connect.h"
|
||||||
#include "sysutil.h"
|
#include "mainmenuscreen.h"
|
||||||
#include "Exit Grids.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "Interface Control.h"
|
|
||||||
#include "message.h"
|
|
||||||
#include "Multi Language Graphic Utils.h"
|
|
||||||
#include "Map Information.h"
|
|
||||||
#include "Sys Globals.h"
|
|
||||||
#include "insurance.h"
|
|
||||||
|
|
||||||
#include "connect.h"
|
|
||||||
#include "worldman.h"
|
|
||||||
#include "Init.h"
|
|
||||||
#include "Game Events.h"
|
|
||||||
|
|
||||||
extern UINT32 guiDoneButton; // symbol already declared globally in AimArchives.cpp (jonathanl)
|
extern UINT32 guiDoneButton; // symbol already declared globally in AimArchives.cpp (jonathanl)
|
||||||
|
|
||||||
|
|||||||
@@ -1,38 +1,30 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "GameInitOptionsScreen.h"
|
#include "GameInitOptionsScreen.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "WCheck.h"
|
#include "WCheck.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "Options Screen.h"
|
#include "Options Screen.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Fade Screen.h"
|
#include "Fade Screen.h"
|
||||||
#include "Cursor Control.h"
|
#include "Cursor Control.h"
|
||||||
#include "Music Control.h"
|
#include "Music Control.h"
|
||||||
#include "Cursors.h"
|
#include "Cursors.h"
|
||||||
#include "Intro.h"
|
#include "Intro.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "_Ja25EnglishText.h"
|
#include "_Ja25EnglishText.h"
|
||||||
#include "Soldier Profile.h"
|
#include "Soldier Profile.h"
|
||||||
|
|
||||||
#include "gameloop.h"
|
|
||||||
#include "connect.h"
|
|
||||||
#include "SaveLoadScreen.h"
|
#include "SaveLoadScreen.h"
|
||||||
|
|
||||||
#ifdef JA2UB
|
|
||||||
#include "ub_config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <vfs/Core/vfs.h>
|
#include <vfs/Core/vfs.h>
|
||||||
#include <vfs/Core/vfs_init.h>
|
|
||||||
#include <vfs/Tools/vfs_property_container.h>
|
#include <vfs/Tools/vfs_property_container.h>
|
||||||
#include <vfs/Core/vfs_os_functions.h>
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
|
#include "ub_config.h"
|
||||||
|
|
||||||
// *********************************
|
// *********************************
|
||||||
// Unfinished Business: Initial Game Screen
|
// Unfinished Business: Initial Game Screen
|
||||||
|
|||||||
+29
-31
@@ -13,7 +13,6 @@
|
|||||||
#include "HelpScreen.h"
|
#include "HelpScreen.h"
|
||||||
#include "INIReader.h"
|
#include "INIReader.h"
|
||||||
#include "Shade Table Util.h"
|
#include "Shade Table Util.h"
|
||||||
#include "soldier profile type.h"
|
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "SaveLoadGame.h"
|
#include "SaveLoadGame.h"
|
||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
@@ -36,7 +35,6 @@
|
|||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "sgp_logger.h"
|
#include "sgp_logger.h"
|
||||||
|
|
||||||
#include "Map Information.h"
|
|
||||||
|
|
||||||
#include "GameInitOptionsScreen.h"
|
#include "GameInitOptionsScreen.h"
|
||||||
|
|
||||||
@@ -156,7 +154,7 @@ BOOLEAN UsingInventoryCostsAPSystem()
|
|||||||
return ( gGameExternalOptions.fInventoryCostsAP );
|
return ( gGameExternalOptions.fInventoryCostsAP );
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string StringToLower(std::string strToConvert)
|
static std::string StringToLower(std::string strToConvert)
|
||||||
{//change each element of the string to lower case
|
{//change each element of the string to lower case
|
||||||
for(unsigned int i=0;i<strToConvert.length();i++)
|
for(unsigned int i=0;i<strToConvert.length();i++)
|
||||||
{
|
{
|
||||||
@@ -185,7 +183,7 @@ BOOLEAN IsNIVModeValid(bool checkRes)
|
|||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateFeatureFlags()
|
static void UpdateFeatureFlags()
|
||||||
{
|
{
|
||||||
// do we need to override some ini settings?
|
// do we need to override some ini settings?
|
||||||
if (gGameSettings.fFeatures[FF_FEATURES_SCREEN])
|
if (gGameSettings.fFeatures[FF_FEATURES_SCREEN])
|
||||||
@@ -279,23 +277,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 +303,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 +330,13 @@ 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_USE_LEGACY_TACTICALAI] = iniReader.ReadBoolean("JA2 Game Settings", "TOPTION_USE_LEGACY_TACTICALAI", FALSE); // A* pathfinding
|
||||||
|
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 +356,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;
|
||||||
|
|
||||||
@@ -618,6 +617,7 @@ BOOLEAN SaveGameSettings()
|
|||||||
settings << "TOPTION_SHOW_ENEMY_LOCATION = " << (gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] ? "TRUE" : "FALSE" ) << endl;
|
settings << "TOPTION_SHOW_ENEMY_LOCATION = " << (gGameSettings.fOptions[TOPTION_SHOW_ENEMY_LOCATION] ? "TRUE" : "FALSE" ) << endl;
|
||||||
settings << "TOPTION_ALT_START_AIM = " << (gGameSettings.fOptions[TOPTION_ALT_START_AIM] ? "TRUE" : "FALSE") << endl;
|
settings << "TOPTION_ALT_START_AIM = " << (gGameSettings.fOptions[TOPTION_ALT_START_AIM] ? "TRUE" : "FALSE") << endl;
|
||||||
settings << "TOPTION_ALT_PATHFINDING = " << (gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] ? "TRUE" : "FALSE") << endl;
|
settings << "TOPTION_ALT_PATHFINDING = " << (gGameSettings.fOptions[TOPTION_ALT_PATHFINDING] ? "TRUE" : "FALSE") << endl;
|
||||||
|
settings << "TOPTION_USE_LEGACY_TACTICALAI = " << (gGameSettings.fOptions[TOPTION_USE_LEGACY_TACTICALAI] ? "TRUE" : "FALSE") << endl;
|
||||||
|
|
||||||
settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
|
settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
|
||||||
settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl;
|
settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl;
|
||||||
@@ -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,8 +846,9 @@ 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;
|
||||||
|
gGameSettings.fOptions[TOPTION_USE_LEGACY_TACTICALAI] = FALSE;
|
||||||
|
|
||||||
// arynn: Cheat/Debug Menu
|
// arynn: Cheat/Debug Menu
|
||||||
gGameSettings.fOptions[ TOPTION_CHEAT_MODE_OPTIONS_HEADER ] = FALSE;
|
gGameSettings.fOptions[ TOPTION_CHEAT_MODE_OPTIONS_HEADER ] = FALSE;
|
||||||
@@ -2101,9 +2102,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 +2896,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 +3612,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);
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ enum
|
|||||||
TOPTION_SHOW_ENEMY_LOCATION,
|
TOPTION_SHOW_ENEMY_LOCATION,
|
||||||
TOPTION_ALT_START_AIM,
|
TOPTION_ALT_START_AIM,
|
||||||
TOPTION_ALT_PATHFINDING,
|
TOPTION_ALT_PATHFINDING,
|
||||||
|
TOPTION_USE_LEGACY_TACTICALAI,
|
||||||
|
|
||||||
// arynn: Debug/Cheat
|
// arynn: Debug/Cheat
|
||||||
TOPTION_CHEAT_MODE_OPTIONS_HEADER,
|
TOPTION_CHEAT_MODE_OPTIONS_HEADER,
|
||||||
|
|||||||
+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
|
||||||
|
|||||||
+20
-25
@@ -1,27 +1,23 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "WCheck.h"
|
||||||
#include "WCheck.h"
|
#include "Cursors.h"
|
||||||
#include "Cursors.h"
|
#include "Font Control.h"
|
||||||
#include "Font Control.h"
|
#include "Render Dirty.h"
|
||||||
#include "Cursor Control.h"
|
#include "Text.h"
|
||||||
#include "Render Dirty.h"
|
#include "Utilities.h"
|
||||||
#include "Text.h"
|
#include "WordWrap.h"
|
||||||
#include "Utilities.h"
|
#include "HelpScreen.h"
|
||||||
#include "WordWrap.h"
|
#include "HelpScreenText.h"
|
||||||
#include "Font Control.h"
|
#include "line.h"
|
||||||
#include "Text.h"
|
#include "Game Clock.h"
|
||||||
#include "HelpScreen.h"
|
#include "GameSettings.h"
|
||||||
#include "HelpScreenText.h"
|
#include "laptop.h"
|
||||||
#include "line.h"
|
#include "Text Input.h"
|
||||||
#include "Game Clock.h"
|
#include "english.h"
|
||||||
#include "GameSettings.h"
|
#include "renderworld.h"
|
||||||
#include "laptop.h"
|
#include "Game Init.h"
|
||||||
#include "Text Input.h"
|
#include "Overhead.h"
|
||||||
#include "english.h"
|
|
||||||
#include "renderworld.h"
|
|
||||||
#include "Game Init.h"
|
|
||||||
#include "Overhead.h"
|
|
||||||
|
|
||||||
extern INT16 gsVIEWPORT_END_Y;
|
extern INT16 gsVIEWPORT_END_Y;
|
||||||
extern void PrintDate( void );
|
extern void PrintDate( void );
|
||||||
@@ -308,7 +304,6 @@ void SelectHelpScrollAreaCallBack( MOUSE_REGION * pRegion, INT32 iReason );
|
|||||||
|
|
||||||
// region to mask the background
|
// region to mask the background
|
||||||
MOUSE_REGION gHelpScreenScrollAreaArrows;
|
MOUSE_REGION gHelpScreenScrollAreaArrows;
|
||||||
void SelectHelpScrollAreaArrowsCallBack( MOUSE_REGION * pRegion, INT32 iReason );
|
|
||||||
|
|
||||||
|
|
||||||
//checkbox to toggle show help again toggle
|
//checkbox to toggle show help again toggle
|
||||||
|
|||||||
+98
-173
@@ -1,55 +1,47 @@
|
|||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "gameloop.h"
|
#include "Screens.h"
|
||||||
#include "Screens.h"
|
#include "vobject_blitters.h"
|
||||||
#include "INIReader.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "worlddef.h"
|
||||||
#include "renderworld.h"
|
#include "Animation Data.h"
|
||||||
#include "mousesystem.h"
|
#include "Overhead.h"
|
||||||
#include "sysutil.h"
|
#include "Font Control.h"
|
||||||
#include "worlddef.h"
|
#include <himage.h>
|
||||||
#include "Animation Data.h"
|
#include <vobject.h>
|
||||||
#include "Overhead.h"
|
#include "Timer Control.h"
|
||||||
#include "Font Control.h"
|
#include "Utilities.h"
|
||||||
#include "Button System.h"
|
#include "Render Dirty.h"
|
||||||
#include "Timer Control.h"
|
#include "Sound Control.h"
|
||||||
#include "Utilities.h"
|
#include "lighting.h"
|
||||||
#include "Radar Screen.h"
|
#include "Cursor Control.h"
|
||||||
#include "Render Dirty.h"
|
#include "Music Control.h"
|
||||||
#include "Sound Control.h"
|
#include "video.h"
|
||||||
#include "Event Pump.h"
|
#include "maputility.h"
|
||||||
#include "lighting.h"
|
#include "strategic.h"
|
||||||
#include "Cursor Control.h"
|
#include "Dialogue Control.h"
|
||||||
#include "Music Control.h"
|
#include "Text.h"
|
||||||
#include "video.h"
|
#include "laptop.h"
|
||||||
#include "mapscreen.h"
|
#include "MercTextBox.h"
|
||||||
#include "Interface Items.h"
|
#include "Tile Cache.h"
|
||||||
#include "maputility.h"
|
#include "strategicmap.h"
|
||||||
#include "strategic.h"
|
#include "Map Information.h"
|
||||||
#include "Dialogue Control.h"
|
#include "Shade Table Util.h"
|
||||||
#include "Text.h"
|
#include "Exit Grids.h"
|
||||||
#include "laptop.h"
|
#include "Summary Info.h"
|
||||||
#include "NPC.h"
|
#include "GameSettings.h"
|
||||||
#include "MercTextBox.h"
|
#include "Game Init.h"
|
||||||
#include "Tile Cache.h"
|
#include "Init.h"
|
||||||
#include "strategicmap.h"
|
#include "jascreens.h"
|
||||||
#include "Map Information.h"
|
#include "XML.h"
|
||||||
#include "Shade Table Util.h"
|
#include "SaveLoadGame.h"
|
||||||
#include "Exit Grids.h"
|
#include "Weapons.h"
|
||||||
#include "Summary Info.h"
|
#include "Strategic Movement.h"
|
||||||
#include "GameSettings.h"
|
#include "Vehicles.h"
|
||||||
#include "Game Init.h"
|
#include "Multilingual Text Code Generator.h"
|
||||||
#include "Init.h"
|
#include "editscreen.h"
|
||||||
#include "jascreens.h"
|
#include "Arms Dealer Init.h"
|
||||||
#include "XML.h"
|
|
||||||
#include "SaveLoadGame.h"
|
|
||||||
#include "Weapons.h"
|
|
||||||
#include "Strategic Movement.h"
|
|
||||||
#include "Vehicles.h"
|
|
||||||
#include "Multilingual Text Code Generator.h"
|
|
||||||
#include "editscreen.h"
|
|
||||||
#include "Arms Dealer Init.h"
|
|
||||||
#include "Map Screen Interface Bottom.h"
|
#include "Map Screen Interface Bottom.h"
|
||||||
#include "MPXmlTeams.hpp"
|
#include "MPXmlTeams.hpp"
|
||||||
#include "Strategic Mines LUA.h"
|
#include "Strategic Mines LUA.h"
|
||||||
@@ -57,8 +49,6 @@
|
|||||||
#include "lua_state.h"
|
#include "lua_state.h"
|
||||||
|
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
#include "Strategic Town Loyalty.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "aim.h"
|
#include "aim.h"
|
||||||
#include "mainmenuscreen.h"
|
#include "mainmenuscreen.h"
|
||||||
#include "email.h"
|
#include "email.h"
|
||||||
@@ -70,7 +60,6 @@
|
|||||||
#include "ub_config.h"
|
#include "ub_config.h"
|
||||||
|
|
||||||
|
|
||||||
#include "Civ Quotes.h"
|
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
#include "BriefingRoom_Data.h"
|
#include "BriefingRoom_Data.h"
|
||||||
#include "AimArchives.h"
|
#include "AimArchives.h"
|
||||||
@@ -96,20 +85,6 @@ extern BOOLEAN GetCDromDriveLetter( STR8 pString );
|
|||||||
extern BOOLEAN gfUseConsecutiveQuickSaveSlots;
|
extern BOOLEAN gfUseConsecutiveQuickSaveSlots;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( GERMAN ) && !defined( _DEBUG )
|
|
||||||
//#define LASERLOCK_ENABLED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef LASERLOCK_ENABLED
|
|
||||||
int LASERLOK_Init( HINSTANCE hInstance );
|
|
||||||
int LASERLOK_Run();
|
|
||||||
int LASERLOK_Check();
|
|
||||||
|
|
||||||
BOOLEAN PrepareLaserLockSystem();
|
|
||||||
void HandleLaserLockResult( BOOLEAN fSuccess );
|
|
||||||
// int TestCall( int n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern HINSTANCE ghInstance;
|
extern HINSTANCE ghInstance;
|
||||||
|
|
||||||
@@ -140,7 +115,7 @@ static void AddLanguagePrefix(STR fileName)
|
|||||||
AddLanguagePrefix( fileName, GetLanguagePrefix());
|
AddLanguagePrefix( fileName, GetLanguagePrefix());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetEmptyRPCFaceSlots()
|
static void ResetEmptyRPCFaceSlots()
|
||||||
{
|
{
|
||||||
//legion by jazz (load small faces from rpcs)
|
//legion by jazz (load small faces from rpcs)
|
||||||
// reset empty slots with "-1"
|
// reset empty slots with "-1"
|
||||||
@@ -1209,40 +1184,61 @@ if( g_lang != i18n::Lang::en ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ReadXMLEmail == TRUE )
|
if ( ReadXMLEmail == TRUE )
|
||||||
{
|
{
|
||||||
|
// Externalized emails
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, EMAILSFILENAME);
|
||||||
|
// Only load external emails if we find the file
|
||||||
|
if ( FileExists(fileName) )
|
||||||
|
{
|
||||||
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
|
SGP_THROW_IFFALSE(ReadInExternalizedEmails(fileName, FALSE), EMAILSFILENAME);
|
||||||
|
|
||||||
|
if ( g_lang != i18n::Lang::en )
|
||||||
|
{
|
||||||
|
AddLanguagePrefix(fileName);
|
||||||
|
if ( FileExists(fileName) )
|
||||||
|
{
|
||||||
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
|
if ( !ReadInExternalizedEmails(fileName, TRUE) )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// EMAIL MERC AVAILABLE by Jazz
|
// EMAIL MERC AVAILABLE by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, EMAILMERCAVAILABLE);
|
strcat(fileName, EMAILMERCAVAILABLE);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName,FALSE), EMAILMERCAVAILABLE);
|
SGP_THROW_IFFALSE(ReadInEmailMercAvailable(fileName, FALSE), EMAILMERCAVAILABLE);
|
||||||
|
|
||||||
if( g_lang != i18n::Lang::en ) {
|
if ( g_lang != i18n::Lang::en )
|
||||||
AddLanguagePrefix(fileName);
|
|
||||||
if ( FileExists(fileName) )
|
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
AddLanguagePrefix(fileName);
|
||||||
if(!ReadInEmailMercAvailable(fileName,TRUE))
|
if ( FileExists(fileName) )
|
||||||
return FALSE;
|
{
|
||||||
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
|
if ( !ReadInEmailMercAvailable(fileName, TRUE) )
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// EMAIL MERC LEVEL UP by Jazz
|
// EMAIL MERC LEVEL UP by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, EMAILMERCLEVELUP);
|
strcat(fileName, EMAILMERCLEVELUP);
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName,FALSE), EMAILMERCLEVELUP);
|
SGP_THROW_IFFALSE(ReadInEmailMercLevelUp(fileName, FALSE), EMAILMERCLEVELUP);
|
||||||
|
|
||||||
if( g_lang != i18n::Lang::en ) {
|
if ( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
if(!ReadInEmailMercLevelUp(fileName,TRUE))
|
if ( !ReadInEmailMercLevelUp(fileName, TRUE) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
// EMAIL OTHER by Jazz
|
// EMAIL OTHER by Jazz
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
@@ -1250,16 +1246,18 @@ if( g_lang != i18n::Lang::en ) {
|
|||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
|
SGP_THROW_IFFALSE(ReadInEmailOther(fileName,FALSE), EMAILOTHER);
|
||||||
|
|
||||||
if( g_lang != i18n::Lang::en ) {
|
if( g_lang != i18n::Lang::en ) {
|
||||||
AddLanguagePrefix(fileName);
|
AddLanguagePrefix(fileName);
|
||||||
if ( FileExists(fileName) )
|
if ( FileExists(fileName) )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("LoadExternalGameplayData, fileName = %s", fileName));
|
||||||
if(!ReadInEmailOther(fileName,TRUE))
|
if(!ReadInEmailOther(fileName,TRUE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
//new vehicles by Jazz
|
//new vehicles by Jazz
|
||||||
|
|
||||||
InitNewVehicles ();
|
InitNewVehicles ();
|
||||||
@@ -1412,11 +1410,6 @@ if( g_lang != i18n::Lang::en ) {
|
|||||||
|
|
||||||
UINT32 InitializeJA2(void)
|
UINT32 InitializeJA2(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef LASERLOCK_ENABLED
|
|
||||||
HandleLaserLockResult( PrepareLaserLockSystem() );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HandleJA2CDCheck( );
|
HandleJA2CDCheck( );
|
||||||
|
|
||||||
gfWorldLoaded = FALSE;
|
gfWorldLoaded = FALSE;
|
||||||
@@ -1680,74 +1673,6 @@ void ShutdownJA2(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef LASERLOCK_ENABLED
|
|
||||||
|
|
||||||
BOOLEAN PrepareLaserLockSystem()
|
|
||||||
{
|
|
||||||
INT32 iInitRetVal=0;
|
|
||||||
INT32 iRunRetVal=0;
|
|
||||||
INT32 iCheckRetVal=0;
|
|
||||||
CHAR8 zDirectory[512];
|
|
||||||
|
|
||||||
CHAR8 zCdLocation[ SGPFILENAME_LEN ];
|
|
||||||
CHAR8 zCdFile[ SGPFILENAME_LEN ];
|
|
||||||
|
|
||||||
//Get the "current" file directory
|
|
||||||
GetFileManCurrentDirectory( zDirectory );
|
|
||||||
|
|
||||||
if( GetCDromDriveLetter( zCdLocation ) )
|
|
||||||
{
|
|
||||||
// OK, build filename
|
|
||||||
sprintf( zCdFile, "%s%s", zCdLocation, "Data" );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
goto FAILED_LASERLOK;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Go back to the root directory
|
|
||||||
SetFileManCurrentDirectory( zCdFile );
|
|
||||||
//Init the laser lock system
|
|
||||||
iInitRetVal = LASERLOK_Init( ghInstance );
|
|
||||||
if( iInitRetVal != 0 )
|
|
||||||
goto FAILED_LASERLOK;
|
|
||||||
|
|
||||||
//makes the verification of the laserlok system
|
|
||||||
iRunRetVal = LASERLOK_Run();
|
|
||||||
if( iRunRetVal != 0 )
|
|
||||||
goto FAILED_LASERLOK;
|
|
||||||
|
|
||||||
//checks the result of the laserlok run function
|
|
||||||
iCheckRetVal = LASERLOK_Check();
|
|
||||||
if( iCheckRetVal != 0 )
|
|
||||||
goto FAILED_LASERLOK;
|
|
||||||
|
|
||||||
//Restore back to the proper directory
|
|
||||||
SetFileManCurrentDirectory( zDirectory );
|
|
||||||
return( TRUE );
|
|
||||||
|
|
||||||
FAILED_LASERLOK:
|
|
||||||
//Restore back to the proper directory
|
|
||||||
SetFileManCurrentDirectory( zDirectory );
|
|
||||||
return( FALSE );
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleLaserLockResult( BOOLEAN fSuccess )
|
|
||||||
{
|
|
||||||
if( !fSuccess )
|
|
||||||
{
|
|
||||||
CHAR8 zString[512];
|
|
||||||
|
|
||||||
sprintf( zString, "%S", gzLateLocalizedString[56] );
|
|
||||||
|
|
||||||
// ShowCursor(TRUE);
|
|
||||||
// ShowCursor(TRUE);
|
|
||||||
ShutdownWithErrorBox( zString );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void SetupMaxActionPointsAnimation()
|
void SetupMaxActionPointsAnimation()
|
||||||
{
|
{
|
||||||
gubMaxActionPoints[REGMALE] = APBPConstants[AP_MAXIMUM];
|
gubMaxActionPoints[REGMALE] = APBPConstants[AP_MAXIMUM];
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "LogicalBodyTypes/SurfaceDB.h"
|
#include "LogicalBodyTypes/SurfaceDB.h"
|
||||||
#include "LogicalBodyTypes/FilterDB.h"
|
#include "LogicalBodyTypes/FilterDB.h"
|
||||||
#include "LogicalBodyTypes/EnumeratorDB.h"
|
#include "LogicalBodyTypes/EnumeratorDB.h"
|
||||||
#include "LogicalBodyTypes/BodyTypeDB.h"
|
|
||||||
#include "LogicalBodyTypes/PaletteDB.h"
|
#include "LogicalBodyTypes/PaletteDB.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|||||||
+13
-36
@@ -1,41 +1,18 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "Cursor Control.h"
|
||||||
#include "Font Control.h"
|
#include "Render Dirty.h"
|
||||||
#include "Cursor Control.h"
|
#include "Utilities.h"
|
||||||
#include "Render Dirty.h"
|
#include "Intro.h"
|
||||||
#include "Text.h"
|
#include "Cinematics.h"
|
||||||
#include "Utilities.h"
|
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "line.h"
|
|
||||||
#include "Intro.h"
|
|
||||||
#include "Cinematics.h"
|
|
||||||
#include "Cinematics Bink.h"
|
|
||||||
#include "mainmenuscreen.h"
|
|
||||||
#include "Music Control.h"
|
|
||||||
#include "LibraryDataBase.h"
|
|
||||||
#include "english.h"
|
|
||||||
#include "soldier profile type.h"
|
|
||||||
#include "MessageBoxScreen.h"
|
|
||||||
#include "sgp_logger.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "Game Init.h"
|
|
||||||
#include "INIReader.h"
|
|
||||||
|
|
||||||
#include <vfs/Core/vfs.h>
|
|
||||||
|
|
||||||
#include "Luaglobal.h"
|
|
||||||
#ifdef JA2UB
|
|
||||||
#include "strategicmap.h"
|
|
||||||
#include "Map Screen Interface Map.h"
|
|
||||||
#include "Map Screen Interface.h"
|
|
||||||
#include "End Game.h"
|
|
||||||
#include "Cinematics Bink.h"
|
#include "Cinematics Bink.h"
|
||||||
#endif
|
#include "mainmenuscreen.h"
|
||||||
|
#include "Music Control.h"
|
||||||
|
#include "english.h"
|
||||||
|
#include "sgp_logger.h"
|
||||||
|
#include "INIReader.h"
|
||||||
|
#include "Luaglobal.h"
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
#include "XML.h"
|
|
||||||
#include <language.hpp>
|
#include <language.hpp>
|
||||||
|
|
||||||
BOOLEAN Style_JA = TRUE;
|
BOOLEAN Style_JA = TRUE;
|
||||||
|
|||||||
+1
-62
@@ -1,72 +1,11 @@
|
|||||||
#include "builddefines.h"
|
#include <types.h>
|
||||||
#include <wchar.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include "Render Fun.h"
|
|
||||||
#include "stdlib.h"
|
|
||||||
#include "DEBUG.H"
|
|
||||||
#include "MemMan.h"
|
|
||||||
#include "Overhead Types.h"
|
|
||||||
//#include "Soldier Control.h"
|
|
||||||
#include "Animation Cache.h"
|
|
||||||
#include "Animation Data.h"
|
|
||||||
#include "Animation Control.h"
|
|
||||||
#include <math.h>
|
|
||||||
#include "PATHAI.H"
|
|
||||||
#include "random.h"
|
|
||||||
#include "Isometric Utils.h"
|
|
||||||
#include "renderworld.h"
|
|
||||||
#include "video.h"
|
|
||||||
#include "Weapons.h"
|
|
||||||
#include "vobject_blitters.h"
|
|
||||||
#include "Handle UI.h"
|
|
||||||
#include "Event Pump.h"
|
|
||||||
#include "ai.h"
|
|
||||||
#include "Interface.h"
|
|
||||||
#include "lighting.h"
|
|
||||||
#include "faces.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "Soldier macros.h"
|
|
||||||
#include "english.h"
|
|
||||||
#include "Squads.h"
|
|
||||||
|
|
||||||
#ifdef NETWORKED
|
#ifdef NETWORKED
|
||||||
#include "Networking.h"
|
#include "Networking.h"
|
||||||
#include "NetworkEvent.h"
|
#include "NetworkEvent.h"
|
||||||
#endif
|
#endif
|
||||||
#include "Items.h"
|
|
||||||
#include "soundman.h"
|
|
||||||
#include "Utilities.h"
|
|
||||||
#include "strategic.h"
|
|
||||||
#include "soldier tile.h"
|
|
||||||
#include "Smell.h"
|
|
||||||
#include "Keys.h"
|
|
||||||
#include "Dialogue Control.h"
|
|
||||||
#include "Soldier Functions.h"
|
|
||||||
#include "Exit Grids.h"
|
|
||||||
#include "Quests.h"
|
|
||||||
#include "message.h"
|
|
||||||
#include "SkillCheck.h"
|
|
||||||
#include "interface Dialogue.h"
|
|
||||||
#include "GameSettings.h"
|
|
||||||
#include "ShopKeeper Interface.h"
|
|
||||||
#include "Vehicles.h"
|
|
||||||
#include "strategicmap.h"
|
|
||||||
#include "Morale.h"
|
|
||||||
#include "Drugs And Alcohol.h"
|
|
||||||
#include "SkillCheck.h"
|
|
||||||
#include "Map Information.h"
|
|
||||||
#include "Buildings.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "Campaign Types.h"
|
|
||||||
#include "Strategic Status.h"
|
|
||||||
#include "Civ Quotes.h"
|
|
||||||
#include "Debug Control.h"
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
|
|
||||||
#include "Ja25_Tactical.h"
|
|
||||||
#include "Ja25 Strategic Ai.h"
|
|
||||||
|
|
||||||
INT16 JA2_5_START_SECTOR_X;
|
INT16 JA2_5_START_SECTOR_X;
|
||||||
INT16 JA2_5_START_SECTOR_Y;
|
INT16 JA2_5_START_SECTOR_Y;
|
||||||
|
|||||||
@@ -5,11 +5,6 @@
|
|||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
|
|
||||||
//Used in the editor to compensate for the 2_<map name>
|
|
||||||
#define JA25_EXP_MAP_NAME_PREFIX L""
|
|
||||||
#define JA25_EXP_MAP_NAME_SIZE_OFFSET 0
|
|
||||||
|
|
||||||
|
|
||||||
//The starting sector of the Expanion pack
|
//The starting sector of the Expanion pack
|
||||||
extern INT16 JA2_5_START_SECTOR_X;
|
extern INT16 JA2_5_START_SECTOR_X;
|
||||||
extern INT16 JA2_5_START_SECTOR_Y;
|
extern INT16 JA2_5_START_SECTOR_Y;
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ extern HVSURFACE ghFrameBuffer;
|
|||||||
extern BOOLEAN gfSchedulesHosed;
|
extern BOOLEAN gfSchedulesHosed;
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
#include "Ja25_Tactical.h"
|
|
||||||
#include "Ja25 Strategic Ai.h"
|
#include "Ja25 Strategic Ai.h"
|
||||||
#endif
|
#endif
|
||||||
UINT8 gubLastLoadingScreenID = LOADINGSCREEN_NOTHING;
|
UINT8 gubLastLoadingScreenID = LOADINGSCREEN_NOTHING;
|
||||||
@@ -344,7 +343,7 @@ static void BuildLoadscreenFilename(std::string& dst, const char* path, int reso
|
|||||||
dst.append(".sti");
|
dst.append(".sti");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetResolutionSuffix(SCREEN_RESOLUTION resolution)
|
static std::string GetResolutionSuffix(SCREEN_RESOLUTION resolution)
|
||||||
{
|
{
|
||||||
switch (resolution)
|
switch (resolution)
|
||||||
{
|
{
|
||||||
@@ -376,7 +375,7 @@ std::string GetResolutionSuffix(SCREEN_RESOLUTION resolution)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string FindBestFittingLoadscreenFilename(const std::string& baseName, SCREEN_RESOLUTION resolution)
|
static std::string FindBestFittingLoadscreenFilename(const std::string& baseName, SCREEN_RESOLUTION resolution)
|
||||||
{
|
{
|
||||||
for (SCREEN_RESOLUTION res = resolution; res <= _2560x1600; res = (SCREEN_RESOLUTION)(res + 1))
|
for (SCREEN_RESOLUTION res = resolution; res <= _2560x1600; res = (SCREEN_RESOLUTION)(res + 1))
|
||||||
{
|
{
|
||||||
|
|||||||
+20
-21
@@ -1,24 +1,23 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "Fade Screen.h"
|
#include "Fade Screen.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "MercTextBox.h"
|
#include "MercTextBox.h"
|
||||||
#include "Cursors.h"
|
#include "Cursors.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "Map Screen Interface.h"
|
||||||
#include "renderworld.h"
|
#include "renderworld.h"
|
||||||
#include "gameloop.h"
|
#include "gameloop.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Cursor Control.h"
|
#include "Cursor Control.h"
|
||||||
#include "laptop.h"
|
#include "Text.h"
|
||||||
#include "Text.h"
|
#include "Text Input.h"
|
||||||
#include "Text Input.h"
|
#include "overhead map.h"
|
||||||
#include "overhead map.h"
|
#include "MPChatScreen.h"
|
||||||
#include "MPChatScreen.h"
|
#include "WordWrap.h"
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
|
|||||||
+22
-33
@@ -1,38 +1,28 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "vobject_blitters.h"
|
#include "Cursors.h"
|
||||||
#include "MercTextBox.h"
|
#include "Font Control.h"
|
||||||
#include "Cursors.h"
|
#include "mainmenuscreen.h"
|
||||||
#include "Font Control.h"
|
#include "Cursor Control.h"
|
||||||
#include "mainmenuscreen.h"
|
#include "Render Dirty.h"
|
||||||
#include "Cursor Control.h"
|
#include "Music Control.h"
|
||||||
#include "Render Dirty.h"
|
|
||||||
#include "Music Control.h"
|
|
||||||
#include "GameSettings.h"
|
|
||||||
#include "SaveLoadScreen.h"
|
|
||||||
#include "SaveLoadGame.h"
|
|
||||||
#include "Options Screen.h"
|
|
||||||
#include "english.h"
|
|
||||||
#include "gameloop.h"
|
|
||||||
#include "Game Init.h"
|
|
||||||
#include "Utilities.h"
|
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "Font Control.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "Multi Language Graphic Utils.h"
|
|
||||||
#include "Encrypted File.h"
|
|
||||||
#include "JA2 Splash.h"
|
|
||||||
#include "GameVersion.h"
|
|
||||||
|
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
|
#include "SaveLoadScreen.h"
|
||||||
|
#include "SaveLoadGame.h"
|
||||||
|
#include "Options Screen.h"
|
||||||
|
#include "english.h"
|
||||||
|
#include "gameloop.h"
|
||||||
|
#include "Game Init.h"
|
||||||
|
#include "WordWrap.h"
|
||||||
|
#include "Text.h"
|
||||||
|
#include "Multi Language Graphic Utils.h"
|
||||||
|
#include "JA2 Splash.h"
|
||||||
|
#include "GameVersion.h"
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "strategic.h"
|
#include "strategic.h"
|
||||||
#include "Strategic Movement.h"
|
#include "Strategic Movement.h"
|
||||||
#include "Overhead.h"
|
|
||||||
#include "Init.h"
|
|
||||||
#include "XML.h"
|
|
||||||
#include <vfs/Core/vfs.h>
|
#include <vfs/Core/vfs.h>
|
||||||
#include <vfs/Core/vfs_profile.h>
|
#include <vfs/Core/vfs_profile.h>
|
||||||
|
|
||||||
@@ -83,7 +73,6 @@ void MenuButtonCallback(GUI_BUTTON *btn, INT32 reason);
|
|||||||
void HandleMainMenuKeyboardInput();
|
void HandleMainMenuKeyboardInput();
|
||||||
void HandleMainMenuInput();
|
void HandleMainMenuInput();
|
||||||
void HandleMainMenuScreen();
|
void HandleMainMenuScreen();
|
||||||
void DisplayAssignmentText();
|
|
||||||
void ClearMainMenu();
|
void ClearMainMenu();
|
||||||
void SelectMainMenuBackGroundRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
void SelectMainMenuBackGroundRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
||||||
void SetMainMenuExitScreen( UINT32 uiNewScreen );
|
void SetMainMenuExitScreen( UINT32 uiNewScreen );
|
||||||
@@ -428,7 +417,7 @@ void MenuButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MenuButtonMoveCallback(GUI_BUTTON *btn,INT32 reason)
|
static void MenuButtonMoveCallback(GUI_BUTTON *btn,INT32 reason)
|
||||||
{
|
{
|
||||||
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
|
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,12 +14,10 @@
|
|||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "Interface Control.h"
|
#include "Interface Control.h"
|
||||||
#include "Cursor Control.h"
|
#include "Cursor Control.h"
|
||||||
#include "laptop.h"
|
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Text Input.h"
|
#include "Text Input.h"
|
||||||
#include "overhead map.h"
|
#include "overhead map.h"
|
||||||
#include "DropDown.h" // added by Flugente
|
#include "DropDown.h" // added by Flugente
|
||||||
#include "Utilities.h" // added by Flugente for FilenameForBPP(...)
|
|
||||||
#include "FeaturesScreen.h"
|
#include "FeaturesScreen.h"
|
||||||
|
|
||||||
#define MSGBOX_DEFAULT_WIDTH 300
|
#define MSGBOX_DEFAULT_WIDTH 300
|
||||||
|
|||||||
+237
-473
File diff suppressed because it is too large
Load Diff
+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;
|
||||||
|
|
||||||
|
|||||||
+1
-14
@@ -9,7 +9,6 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "finances.h"
|
|
||||||
#include "WCheck.h"
|
#include "WCheck.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "Cursors.h"
|
#include "Cursors.h"
|
||||||
@@ -19,7 +18,6 @@
|
|||||||
#include "Options Screen.h"
|
#include "Options Screen.h"
|
||||||
#include "GameVersion.h"
|
#include "GameVersion.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Tactical Save.h"
|
|
||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "gamescreen.h"
|
#include "gamescreen.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
@@ -31,7 +29,6 @@
|
|||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "Map Screen Interface.h"
|
||||||
#include "Multi Language Graphic Utils.h"
|
#include "Multi Language Graphic Utils.h"
|
||||||
#include "Campaign Types.h"
|
|
||||||
#include "PostalService.h"
|
#include "PostalService.h"
|
||||||
|
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
@@ -41,10 +38,6 @@
|
|||||||
#include <vfs/Core/vfs_file_raii.h>
|
#include <vfs/Core/vfs_file_raii.h>
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
#include "Strategic Movement.h"
|
|
||||||
|
|
||||||
//#include "Strategic Movement Costs.h"
|
|
||||||
|
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1398,7 +1391,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 +1661,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 +1679,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 ) ) )
|
||||||
{
|
{
|
||||||
|
|||||||
+22
-30
@@ -1,30 +1,22 @@
|
|||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <types.h>
|
||||||
#include "sgp.h"
|
#include <video.h>
|
||||||
#include "gameloop.h"
|
#include <MemMan.h>
|
||||||
#include "himage.h"
|
#include <Overhead Types.h>
|
||||||
#include "vobject.h"
|
#include <Soldier Control.h>
|
||||||
#include "vobject_blitters.h"
|
#include "renderworld.h"
|
||||||
#include "worlddef.h"
|
#include "input.h"
|
||||||
#include "renderworld.h"
|
#include "Font.h"
|
||||||
#include "input.h"
|
#include "screenids.h"
|
||||||
#include "Font.h"
|
#include "Overhead.h"
|
||||||
#include "screenids.h"
|
#include "Font Control.h"
|
||||||
#include "Overhead.h"
|
#include "Animation Control.h"
|
||||||
#include "sysutil.h"
|
#include "Animation Data.h"
|
||||||
#include "Font Control.h"
|
#include "Render Dirty.h"
|
||||||
#include "Animation Control.h"
|
#include "Sys Globals.h"
|
||||||
#include "Animation Data.h"
|
#include "english.h"
|
||||||
#include "Event Pump.h"
|
#include "MessageBoxScreen.h"
|
||||||
#include "Render Dirty.h"
|
|
||||||
#include "Sys Globals.h"
|
|
||||||
#include "Interface.h"
|
|
||||||
#include <wchar.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
#include "english.h"
|
|
||||||
#include "FileMan.h"
|
|
||||||
#include "MessageBoxScreen.h"
|
|
||||||
|
|
||||||
//forward declarations of common classes to eliminate includes
|
//forward declarations of common classes to eliminate includes
|
||||||
class OBJECTTYPE;
|
class OBJECTTYPE;
|
||||||
@@ -44,7 +36,7 @@ static UINT8 ubNumStates = 0;
|
|||||||
static UINT16 *pusStates = NULL;
|
static UINT16 *pusStates = NULL;
|
||||||
static INT8 ubCurLoadedState = 0;
|
static INT8 ubCurLoadedState = 0;
|
||||||
|
|
||||||
void CycleAnimations( )
|
static void CycleAnimations( )
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
INT32 cnt;
|
||||||
|
|
||||||
@@ -104,7 +96,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;
|
||||||
|
|
||||||
@@ -318,7 +310,7 @@ UINT32 AniEditScreenHandle(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UINT16 GetAnimStateFromName( STR8 zName )
|
static UINT16 GetAnimStateFromName( STR8 zName )
|
||||||
{
|
{
|
||||||
INT32 cnt;
|
INT32 cnt;
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
+1
-6
@@ -1,4 +1,3 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "gameloop.h"
|
#include "gameloop.h"
|
||||||
@@ -17,20 +16,16 @@
|
|||||||
#include "Tactical Save.h"
|
#include "Tactical Save.h"
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "mapscreen.h"
|
|
||||||
#include "Interface Control.h"
|
#include "Interface Control.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "HelpScreen.h"
|
#include "HelpScreen.h"
|
||||||
#include "PreBattle Interface.h"
|
#include "PreBattle Interface.h"
|
||||||
#include "Tactical Placement GUI.h"//dnl ch45 071009
|
|
||||||
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
|
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
|
||||||
#include "World Items.h"//dnl ch77 191113
|
#include "World Items.h"//dnl ch77 191113
|
||||||
#include "Overhead.h" // added by Flugente
|
|
||||||
#include "Ambient Control.h" // sevenfm
|
#include "Ambient Control.h" // sevenfm
|
||||||
|
|
||||||
#include "SaveLoadScreen.h"
|
#include "SaveLoadScreen.h"
|
||||||
|
|
||||||
#include "Lua Interpreter.h"
|
|
||||||
//**ddd direct link libraries
|
//**ddd direct link libraries
|
||||||
#pragma comment (lib, "user32.lib")
|
#pragma comment (lib, "user32.lib")
|
||||||
#pragma comment (lib, "gdi32.lib")
|
#pragma comment (lib, "gdi32.lib")
|
||||||
@@ -80,7 +75,7 @@ void HandleNewScreenChange( UINT32 uiNewScreen, UINT32 uiOldScreen );
|
|||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
BOOLEAN gubReportMapscreenLock = 0;
|
BOOLEAN gubReportMapscreenLock = 0;
|
||||||
void ReportMapscreenErrorLock()
|
static void ReportMapscreenErrorLock()
|
||||||
{
|
{
|
||||||
switch( gubReportMapscreenLock )
|
switch( gubReportMapscreenLock )
|
||||||
{
|
{
|
||||||
|
|||||||
+92
-117
@@ -1,85 +1,68 @@
|
|||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include "sgp.h"
|
||||||
#include "sgp.h"
|
#include "gameloop.h"
|
||||||
#include "gameloop.h"
|
#include <Overhead Types.h>
|
||||||
#include "vobject.h"
|
#include <Soldier Control.h>
|
||||||
#include "worlddef.h"
|
#include "renderworld.h"
|
||||||
#include "renderworld.h"
|
#include "Font.h"
|
||||||
#include "Font.h"
|
#include "screenids.h"
|
||||||
#include "screenids.h"
|
#include "Screens.h"
|
||||||
#include "Screens.h"
|
#include <Meanwhile.h>
|
||||||
#include "Overhead.h"
|
#include "HelpScreen.h"
|
||||||
#include "Isometric Utils.h"
|
#include "Overhead.h"
|
||||||
#include "sysutil.h"
|
#include "Event Pump.h"
|
||||||
#include "input.h"
|
#include "Font Control.h"
|
||||||
#include "Event Pump.h"
|
#include "Timer Control.h"
|
||||||
#include "Font Control.h"
|
#include "Radar Screen.h"
|
||||||
#include "Timer Control.h"
|
#include "Render Dirty.h"
|
||||||
#include "Radar Screen.h"
|
#include "Interface.h"
|
||||||
#include "Render Dirty.h"
|
#include "Handle UI.h"
|
||||||
#include "Interface.h"
|
#include "Cursors.h"
|
||||||
#include "Handle UI.h"
|
#include "vobject_blitters.h"
|
||||||
#include <wchar.h>
|
#include "Button System.h"
|
||||||
#include <tchar.h>
|
#include "lighting.h"
|
||||||
#include "Cursors.h"
|
#include "Sys Globals.h"
|
||||||
#include "vobject_blitters.h"
|
#include "environment.h"
|
||||||
#include "Button System.h"
|
#include "Bullets.h"
|
||||||
#include "lighting.h"
|
#include <mousesystem.h>
|
||||||
#include "renderworld.h"
|
#include "message.h"
|
||||||
#include "Sys Globals.h"
|
#include "overhead map.h"
|
||||||
#include "environment.h"
|
#include "Strategic Exit GUI.h"
|
||||||
#include "Bullets.h"
|
#include "Tactical Placement GUI.h"
|
||||||
#include "Assignments.h"
|
#include "Air Raid.h"
|
||||||
#include "message.h"
|
#include "Game Clock.h"
|
||||||
#include <string.h>
|
#include "Game Init.h"
|
||||||
#include "overhead map.h"
|
|
||||||
#include "Strategic Exit GUI.h"
|
|
||||||
#include "Strategic Movement.h"
|
|
||||||
#include "Tactical Placement GUI.h"
|
|
||||||
#include "Air Raid.h"
|
|
||||||
#include "Game Clock.h"
|
|
||||||
#include "Game Init.h"
|
|
||||||
|
|
||||||
//DEF: Test Code
|
|
||||||
#ifdef NETWORKED
|
|
||||||
#include "Networking.h"
|
|
||||||
#endif
|
|
||||||
#include "Interface Control.h"
|
|
||||||
#include "Game Clock.h"
|
|
||||||
#include "physics.h"
|
|
||||||
#include "Fade Screen.h"
|
|
||||||
#include "Dialogue Control.h"
|
|
||||||
#include "Soldier macros.h"
|
|
||||||
#include "faces.h"
|
|
||||||
#include "strategicmap.h"
|
|
||||||
#include "gamescreen.h"
|
|
||||||
#include "Interface.h"
|
|
||||||
#include "Cursor Control.h"
|
|
||||||
#include "Strategic Turns.h"
|
|
||||||
|
|
||||||
#include "merc entering.h"
|
|
||||||
#include "Soldier Create.h"
|
|
||||||
#include "Soldier Init List.h"
|
|
||||||
#include "Interface Panels.h"
|
|
||||||
#include "Map Information.h"
|
|
||||||
#include "environment.h"
|
|
||||||
#include "Squads.h"
|
|
||||||
#include "interface Dialogue.h"
|
|
||||||
#include "Auto Bandage.h"
|
|
||||||
#include "Meanwhile.h"
|
|
||||||
#include "Strategic AI.h"
|
|
||||||
#include "HelpScreen.h"
|
|
||||||
#include "PreBattle Interface.h"
|
|
||||||
#include "Sound Control.h"
|
|
||||||
#include "MessageBoxScreen.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "GameSettings.h"
|
|
||||||
#include "random.h"
|
|
||||||
#include "editscreen.h"
|
|
||||||
#include "Scheduling.h"
|
|
||||||
#include "Animated ProgressBar.h"
|
|
||||||
|
|
||||||
|
//DEF: Test Code
|
||||||
|
#ifdef NETWORKED
|
||||||
|
#include "Networking.h"
|
||||||
|
#endif
|
||||||
|
#include "Interface Control.h"
|
||||||
|
#include "physics.h"
|
||||||
|
#include "Fade Screen.h"
|
||||||
|
#include "Dialogue Control.h"
|
||||||
|
#include "Soldier macros.h"
|
||||||
|
#include "faces.h"
|
||||||
|
#include "strategicmap.h"
|
||||||
|
#include "gamescreen.h"
|
||||||
|
#include "Cursor Control.h"
|
||||||
|
#include "Strategic Turns.h"
|
||||||
|
#include "merc entering.h"
|
||||||
|
#include "Interface Panels.h"
|
||||||
|
#include "Map Information.h"
|
||||||
|
#include "Squads.h"
|
||||||
|
#include "interface Dialogue.h"
|
||||||
|
#include "Auto Bandage.h"
|
||||||
|
#include "PreBattle Interface.h"
|
||||||
|
#include "Sound Control.h"
|
||||||
|
#include "MessageBoxScreen.h"
|
||||||
|
#include "Text.h"
|
||||||
|
#include "GameSettings.h"
|
||||||
|
#include "random.h"
|
||||||
|
#include "editscreen.h"
|
||||||
|
#include "Scheduling.h"
|
||||||
|
#include "Animated ProgressBar.h"
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
@@ -108,10 +91,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 +244,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 +563,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 +667,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 +718,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 +916,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 +1013,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 +1030,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 +1055,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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -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( );
|
||||||
|
|||||||
+53
-82
@@ -1,51 +1,38 @@
|
|||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
#include <stdio.h>
|
#include <cstdio>
|
||||||
#include <time.h>
|
#include "sgp.h"
|
||||||
#include "sgp.h"
|
#include "gameloop.h"
|
||||||
#include "gameloop.h"
|
#include "himage.h"
|
||||||
#include "himage.h"
|
#include "vobject.h"
|
||||||
#include "vobject.h"
|
#include "vobject_blitters.h"
|
||||||
#include "vobject_blitters.h"
|
#include "WCheck.h"
|
||||||
#include "WCheck.h"
|
#include "input.h"
|
||||||
#include "input.h"
|
#include "Font.h"
|
||||||
#include "Font.h"
|
#include "screenids.h"
|
||||||
#include "timer.h"
|
#include "Screens.h"
|
||||||
#include "mousesystem.h"
|
#include "Font Control.h"
|
||||||
#include "screenids.h"
|
#include <Overhead Types.h>
|
||||||
#include "Screens.h"
|
#include <Soldier Control.h>
|
||||||
#include "Font Control.h"
|
#include "Timer Control.h"
|
||||||
#include "sysutil.h"
|
#include "Sys Globals.h"
|
||||||
#include "tiledef.h"
|
#include <Handle UI.h>
|
||||||
#include "worlddef.h"
|
#include "Overhead.h"
|
||||||
#include "editscreen.h"
|
#include "Utilities.h"
|
||||||
#include <wchar.h>
|
#include "Render Dirty.h"
|
||||||
#include <tchar.h>
|
#include "jascreens.h"
|
||||||
#include "Timer Control.h"
|
#include "mainmenuscreen.h"
|
||||||
#include "Sys Globals.h"
|
#include "Game Init.h"
|
||||||
#include "Interface.h"
|
#include "Init.h"
|
||||||
#include "Overhead.h"
|
#include "Cursor Control.h"
|
||||||
#include "Utilities.h"
|
#include "GameVersion.h"
|
||||||
#include "Render Dirty.h"
|
#include "Game Clock.h"
|
||||||
#include "jascreens.h"
|
#include "gamescreen.h"
|
||||||
#include "gameloop.h"
|
#include "english.h"
|
||||||
#include "Event Pump.h"
|
#include "random.h"
|
||||||
#include "Animation Cache.h"
|
#include "WordWrap.h"
|
||||||
#include "lighting.h"
|
#include "Sound Control.h"
|
||||||
#include "mainmenuscreen.h"
|
#include "Text.h"
|
||||||
#include "Game Init.h"
|
#include "INIReader.h"
|
||||||
#include "Init.h"
|
|
||||||
#include "Cursor Control.h"
|
|
||||||
#include "Utilities.h"
|
|
||||||
#include "GameVersion.h"
|
|
||||||
#include "Game Clock.h"
|
|
||||||
#include "gamescreen.h"
|
|
||||||
#include "english.h"
|
|
||||||
#include "random.h"
|
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "Sound Control.h"
|
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "INIReader.h"
|
|
||||||
|
|
||||||
#include "sgp_logger.h"
|
#include "sgp_logger.h"
|
||||||
#include <language.hpp>
|
#include <language.hpp>
|
||||||
@@ -514,31 +501,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 +530,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 +562,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 +589,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 +616,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;
|
||||||
@@ -679,7 +650,7 @@ UINT32 DebugScreenInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN CheckForAndExitTacticalDebug( )
|
static BOOLEAN CheckForAndExitTacticalDebug( )
|
||||||
{
|
{
|
||||||
if ( gfExitDebugScreen )
|
if ( gfExitDebugScreen )
|
||||||
{
|
{
|
||||||
@@ -696,7 +667,7 @@ BOOLEAN CheckForAndExitTacticalDebug( )
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExitDebugScreen( )
|
static void ExitDebugScreen( )
|
||||||
{
|
{
|
||||||
if ( guiCurrentScreen == DEBUG_SCREEN )
|
if ( guiCurrentScreen == DEBUG_SCREEN )
|
||||||
{
|
{
|
||||||
@@ -951,7 +922,7 @@ UINT32 DemoExitScreenInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DoneFadeOutForDemoExitScreen( void )
|
static void DoneFadeOutForDemoExitScreen( void )
|
||||||
{
|
{
|
||||||
gfProgramIsRunning = FALSE;
|
gfProgramIsRunning = FALSE;
|
||||||
}
|
}
|
||||||
@@ -959,7 +930,7 @@ void DoneFadeOutForDemoExitScreen( void )
|
|||||||
// unused
|
// unused
|
||||||
//extern INT8 gbFadeSpeed;
|
//extern INT8 gbFadeSpeed;
|
||||||
|
|
||||||
void DisplayTopwareGermanyAddress()
|
static void DisplayTopwareGermanyAddress()
|
||||||
{
|
{
|
||||||
VOBJECT_DESC vo_desc;
|
VOBJECT_DESC vo_desc;
|
||||||
UINT32 uiTempID;
|
UINT32 uiTempID;
|
||||||
|
|||||||
@@ -1,277 +0,0 @@
|
|||||||
//legion 2
|
|
||||||
#include "types.h"
|
|
||||||
#include "types.h"
|
|
||||||
#include "random.h"
|
|
||||||
#include "Campaign Types.h"
|
|
||||||
#include "Queen Command.h"
|
|
||||||
#include "Overhead.h"
|
|
||||||
#include "Strategic Movement.h"
|
|
||||||
#include "Strategic Status.h"
|
|
||||||
#include "GameSettings.h"
|
|
||||||
#include "Strategic AI.h"
|
|
||||||
#include "XML.h"
|
|
||||||
#include "INIReader.h"
|
|
||||||
#include "Game Event Hook.h"
|
|
||||||
#include "sgp.h"
|
|
||||||
#include "jascreens.h"
|
|
||||||
#include "laptop.h"
|
|
||||||
#include "worlddef.h"
|
|
||||||
#include "Soldier Control.h"
|
|
||||||
#include "Overhead.h"
|
|
||||||
#include "email.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "strategicmap.h"
|
|
||||||
#include "Game Init.h"
|
|
||||||
#include "Animation Data.h"
|
|
||||||
#include "Soldier Create.h"
|
|
||||||
#include "Soldier Init List.h"
|
|
||||||
#include "strategic.h"
|
|
||||||
#include "Squads.h"
|
|
||||||
#include "Strategic Town Loyalty.h"
|
|
||||||
#include "Strategic Mines.h"
|
|
||||||
#include "gameloop.h"
|
|
||||||
#include "random.h"
|
|
||||||
#include "Map Screen Interface.h"
|
|
||||||
#include "Tactical Save.h"
|
|
||||||
#include "Campaign Types.h"
|
|
||||||
#include "message.h"
|
|
||||||
#include "Game Event Hook.h"
|
|
||||||
#include "Strategic Movement.h"
|
|
||||||
#include "Quests.h"
|
|
||||||
#include "Strategic AI.h"
|
|
||||||
#include "Dialogue Control.h"
|
|
||||||
#include "GameSettings.h"
|
|
||||||
#include "INIReader.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "XML.h"
|
|
||||||
#include "Item Types.h"
|
|
||||||
#include "Items.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "GameSettings.h"
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
|
||||||
#include "Ja25 Strategic Ai.h"
|
|
||||||
#include "Ja25Update.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "legion cfg.h" //legion2
|
|
||||||
#include "Campaign Types.h"
|
|
||||||
#include "Interface.h"
|
|
||||||
#include "Map Screen Interface Map.h"
|
|
||||||
#include "renderworld.h"
|
|
||||||
#include "connect.h"
|
|
||||||
#include "XMLWriter.h"
|
|
||||||
#include "Debug Control.h"
|
|
||||||
#include <vfs/Core/vfs.h>
|
|
||||||
|
|
||||||
GAME_LEGION_OPTIONS gGameLegionOptions;
|
|
||||||
|
|
||||||
#define GAME_LEGION_OPTIONS_FILE "UB_Options.ini"
|
|
||||||
|
|
||||||
void LoadGameLegionOptions();
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
|
||||||
void RandomAddEnemy( UINT8 SectorX, UINT8 SectorY, UINT8 Level );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void RandomStats ();
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
|
||||||
|
|
||||||
void RandomAddEnemy( UINT8 SectorX, UINT8 SectorY, UINT8 Level )
|
|
||||||
{
|
|
||||||
UNDERGROUND_SECTORINFO *pSector;
|
|
||||||
UINT8 ubNumAdmins = 0;
|
|
||||||
UINT8 ubNumTroops = 0;
|
|
||||||
UINT8 ubNumElites = 0;
|
|
||||||
|
|
||||||
if ( Level != 0 )
|
|
||||||
{
|
|
||||||
pSector = FindUnderGroundSector( SectorX, SectorY, Level );
|
|
||||||
if ( pSector )
|
|
||||||
{
|
|
||||||
if ( pSector->fVisited != TRUE )
|
|
||||||
{
|
|
||||||
switch( gGameOptions.ubDifficultyLevel )
|
|
||||||
{
|
|
||||||
case DIF_LEVEL_EASY:
|
|
||||||
ubNumAdmins = Random( 0 );
|
|
||||||
ubNumTroops = 10 + Random( 5 );
|
|
||||||
ubNumElites = Random( 4 );
|
|
||||||
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
|
|
||||||
break;
|
|
||||||
case DIF_LEVEL_MEDIUM:
|
|
||||||
ubNumAdmins = Random( 0 );
|
|
||||||
ubNumTroops = 15 + Random( 8 );
|
|
||||||
ubNumElites = 1 + Random( 2 );
|
|
||||||
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
|
|
||||||
break;
|
|
||||||
case DIF_LEVEL_HARD:
|
|
||||||
ubNumAdmins = Random( 0 );
|
|
||||||
ubNumTroops = 20 + Random( 7 );
|
|
||||||
ubNumElites = 2 + Random( 2 );
|
|
||||||
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
|
|
||||||
break;
|
|
||||||
case DIF_LEVEL_INSANE:
|
|
||||||
ubNumAdmins = Random( 0 );
|
|
||||||
ubNumTroops = 20 + Random( 3 );
|
|
||||||
ubNumElites = 6 + Random( 3 );
|
|
||||||
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( !GetSectorFlagStatus( SectorX, SectorY, Level, SF_ALREADY_VISITED ) )
|
|
||||||
{
|
|
||||||
switch( gGameOptions.ubDifficultyLevel )
|
|
||||||
{
|
|
||||||
case DIF_LEVEL_EASY:
|
|
||||||
ubNumAdmins = Random( 0 );
|
|
||||||
ubNumTroops = 10 + Random( 5 );
|
|
||||||
ubNumElites = Random( 4 );
|
|
||||||
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
|
|
||||||
break;
|
|
||||||
case DIF_LEVEL_MEDIUM:
|
|
||||||
ubNumAdmins = Random( 0 );
|
|
||||||
ubNumTroops = 15 + Random( 8 );
|
|
||||||
ubNumElites = 1 + Random( 2 );
|
|
||||||
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
|
|
||||||
break;
|
|
||||||
case DIF_LEVEL_HARD:
|
|
||||||
ubNumAdmins = Random( 0 );
|
|
||||||
ubNumTroops = 23 + Random( 7);
|
|
||||||
ubNumElites = 2 + Random( 2 );
|
|
||||||
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
|
|
||||||
break;
|
|
||||||
case DIF_LEVEL_INSANE:
|
|
||||||
ubNumAdmins = Random( 0 );
|
|
||||||
ubNumTroops = 20 + Random( 3 );
|
|
||||||
ubNumElites = 6 + Random( 3 );
|
|
||||||
SetNumberJa25EnemiesInSector( SectorX, SectorY, Level, ubNumAdmins, ubNumTroops, ubNumElites );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void LoadGameLegionOptions()
|
|
||||||
{
|
|
||||||
#ifdef JA2UB
|
|
||||||
JA2_5_START_SECTOR_X = gGameExternalOptions.ubDefaultArrivalSectorX;
|
|
||||||
JA2_5_START_SECTOR_Y = gGameExternalOptions.ubDefaultArrivalSectorY;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gGameLegionOptions.MercStartingGear25XML = TRUE;
|
|
||||||
gGameLegionOptions.LOCATEGRIDNO = gGameExternalOptions.iInitialMercArrivalLocation;
|
|
||||||
gGameLegionOptions.LOCATEGRIDNO2 = 0;
|
|
||||||
gGameLegionOptions.OLDUBInventory = FALSE;
|
|
||||||
|
|
||||||
CIniReader iniReader(GAME_LEGION_OPTIONS_FILE);
|
|
||||||
|
|
||||||
// -----------------------
|
|
||||||
// Unfinished Business
|
|
||||||
// -----------------------
|
|
||||||
|
|
||||||
gGameLegionOptions.BorderTown = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_TOWN", TRUE);
|
|
||||||
gGameLegionOptions.BorderMine = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_MINE", TRUE);
|
|
||||||
gGameLegionOptions.BorderTeams = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_TEAMS", TRUE);
|
|
||||||
gGameLegionOptions.BorderMilitia = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_MILITIA", FALSE);
|
|
||||||
gGameLegionOptions.BorderAirspace = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_AIRSPACE", TRUE);
|
|
||||||
gGameLegionOptions.BorderItem = iniReader.ReadBoolean("Unfinished Business Settings","BORDER_ITEM", TRUE);
|
|
||||||
|
|
||||||
gGameLegionOptions.EventAttackInitialSectorIfPlayerStillThere = iniReader.ReadBoolean("Unfinished Business Settings","EVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE", TRUE);
|
|
||||||
gGameLegionOptions.HandleAddingEnemiesToTunnelMaps = iniReader.ReadBoolean("Unfinished Business Settings","HANDLE_ADDING_ENEMIES_TO_TUNNEL_MAPS", TRUE);
|
|
||||||
gGameLegionOptions.ubEndDefaultSectorX = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_X", 16, 1, 16);
|
|
||||||
gGameLegionOptions.ubEndDefaultSectorY = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_Y", 11, 1, 16);
|
|
||||||
gGameLegionOptions.ubEndDefaultSectorZ = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_Z", 0, 0, 16);
|
|
||||||
gGameLegionOptions.AutoResolove = iniReader.ReadBoolean("Unfinished Business Settings","AUTO_RESOLVE", FALSE);
|
|
||||||
|
|
||||||
gGameLegionOptions.InitialHeliGridNo[ 0 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_1", 14947);
|
|
||||||
gGameLegionOptions.InitialHeliGridNo[ 1 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_2", 15584);
|
|
||||||
gGameLegionOptions.InitialHeliGridNo[ 2 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_3", 15754);
|
|
||||||
gGameLegionOptions.InitialHeliGridNo[ 3 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_4", 16232);
|
|
||||||
gGameLegionOptions.InitialHeliGridNo[ 4 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_5", 16067);
|
|
||||||
gGameLegionOptions.InitialHeliGridNo[ 5 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_6", 16230);
|
|
||||||
gGameLegionOptions.InitialHeliGridNo[ 6 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_GRIDNO_7", 15272);
|
|
||||||
|
|
||||||
gGameLegionOptions.InitalHeliRandomTimes[ 0 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_1", 1300);
|
|
||||||
gGameLegionOptions.InitalHeliRandomTimes[ 1 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_2", 2000);
|
|
||||||
gGameLegionOptions.InitalHeliRandomTimes[ 2 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_3", 2750);
|
|
||||||
gGameLegionOptions.InitalHeliRandomTimes[ 3 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_4", 3400);
|
|
||||||
gGameLegionOptions.InitalHeliRandomTimes[ 4 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_5", 4160);
|
|
||||||
gGameLegionOptions.InitalHeliRandomTimes[ 5 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_6", 4700);
|
|
||||||
gGameLegionOptions.InitalHeliRandomTimes[ 6 ] = iniReader.ReadInteger("Unfinished Business Settings","INITIAL_HELICOPTER_RANDOM_TIME_7", 5630);
|
|
||||||
|
|
||||||
gGameLegionOptions.InGameHeliCrash = iniReader.ReadBoolean("Unfinished Business Settings","ENABLE_UB_HELICOPTER_CRASH", TRUE);
|
|
||||||
gGameLegionOptions.JerryQuotes = iniReader.ReadBoolean("Unfinished Business Settings","JERRY_QUOTES", TRUE);
|
|
||||||
gGameLegionOptions.InJerry = iniReader.ReadBoolean("Unfinished Business Settings","JERRY", TRUE);
|
|
||||||
gGameLegionOptions.JerryGridNo = iniReader.ReadInteger("Unfinished Business Settings","JERRY_GRIDNO", 15109);
|
|
||||||
gGameLegionOptions.InGameHeli = iniReader.ReadBoolean("Unfinished Business Settings","ENABLE_JA2_HELICOPTER_LANDING", FALSE);
|
|
||||||
|
|
||||||
gGameLegionOptions.SwitchInMorrisAreaGridNo = iniReader.ReadInteger("Unfinished Business Settings","SWITCH_IN_MORRIS_AREA_GRIDNO", 15231);
|
|
||||||
gGameLegionOptions.SwitchToLaunchMisslesGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","SWITCH_TO_LAUNCH_MISSLES_GRIDNO_1", 14268);
|
|
||||||
gGameLegionOptions.SwitchToLaunchMisslesGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","SWITCH_TO_LAUNCH_MISSLES_GRIDNO_2", 15708);
|
|
||||||
gGameLegionOptions.RadioLocatorsGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","RADIO_LOCATORS_GRIDNO_1", 15070);
|
|
||||||
gGameLegionOptions.RadioLocatorsGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","RADIO_LOCATORS_GRIDNO_2", 14744);
|
|
||||||
gGameLegionOptions.PowergenSectorGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_1", 15100);
|
|
||||||
gGameLegionOptions.PowergenSectorGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_2", 12220);
|
|
||||||
gGameLegionOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155);
|
|
||||||
gGameLegionOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980);
|
|
||||||
|
|
||||||
gGameLegionOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749);
|
|
||||||
gGameLegionOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979);
|
|
||||||
gGameLegionOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749);
|
|
||||||
gGameLegionOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980);
|
|
||||||
gGameLegionOptions.StopPowergenFanGridNo = iniReader.ReadInteger("Unfinished Business Settings","STOP_POWERGEN_FAN_GRIDNO", 10980);
|
|
||||||
|
|
||||||
//sec J13
|
|
||||||
gGameLegionOptions.FanGridNo[0] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_1", 10978);
|
|
||||||
gGameLegionOptions.FanGridNo[1] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_2", 10979);
|
|
||||||
gGameLegionOptions.FanGridNo[2] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_3", 10980);
|
|
||||||
gGameLegionOptions.FanGridNo[3] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_4", 10818);
|
|
||||||
gGameLegionOptions.FanGridNo[4] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_5", 10819);
|
|
||||||
gGameLegionOptions.FanGridNo[5] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_6", 10820);
|
|
||||||
gGameLegionOptions.FanGridNo[6] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_7", 10658);
|
|
||||||
gGameLegionOptions.FanGridNo[7] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_8", 10659);
|
|
||||||
gGameLegionOptions.FanGridNo[8] = iniReader.ReadInteger("Unfinished Business Settings","FAN_GRIDNO_9", 10660);
|
|
||||||
|
|
||||||
if ( gGameLegionOptions.InGameHeli == TRUE )
|
|
||||||
gGameLegionOptions.InGameHeliCrash = FALSE;
|
|
||||||
|
|
||||||
if ( gGameLegionOptions.InGameHeliCrash == TRUE )
|
|
||||||
gGameLegionOptions.InGameHeli = FALSE;
|
|
||||||
|
|
||||||
if ( gGameLegionOptions.InGameHeli == TRUE && gGameLegionOptions.InGameHeliCrash == TRUE )
|
|
||||||
{
|
|
||||||
gGameLegionOptions.InGameHeliCrash = TRUE;
|
|
||||||
gGameLegionOptions.InGameHeli = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------
|
|
||||||
// Campaign
|
|
||||||
// -----------------------
|
|
||||||
|
|
||||||
gGameLegionOptions.EnemyXML = iniReader.ReadBoolean("Campaign Settings","USE_ENEMY_ARMY_XMLS", TRUE);
|
|
||||||
gGameLegionOptions.AddRandomEnemyToSector = iniReader.ReadBoolean("Campaign Settings","ADD_RANDOM_ENEMY_TO_SECTOR", FALSE);
|
|
||||||
gGameLegionOptions.StrategicMovementCostsXML = iniReader.ReadBoolean("Campaign Settings","STRATEGIC_MOVEMENT_COSTS_XML", FALSE);
|
|
||||||
gGameLegionOptions.MakeStrategicMovementCosts = iniReader.ReadBoolean("Campaign Settings","MAKE_STRATEGIC_MOVEMENT_COSTS", FALSE);
|
|
||||||
gGameLegionOptions.LaptopQuestEnabled = iniReader.ReadBoolean("Campaign Settings","LAPTOP_QUEST", TRUE);
|
|
||||||
gGameLegionOptions.pJA2UB = iniReader.ReadBoolean("Campaign Settings","JA2UB", TRUE);
|
|
||||||
gGameLegionOptions.fDeadMerc = iniReader.ReadBoolean("Campaign Settings","NOTIFY_ON_DEAD_AIM_MERCS", FALSE);
|
|
||||||
|
|
||||||
// -----------------------
|
|
||||||
// Laptop
|
|
||||||
// -----------------------
|
|
||||||
|
|
||||||
gGameLegionOptions.LaptopIMPPassJA2 = iniReader.ReadBoolean("Laptop Settings","IMP_PASS_JA2", FALSE);
|
|
||||||
gGameLegionOptions.LaptopIMPPassUB = iniReader.ReadBoolean("Laptop Settings","IMP_PASS_UB", TRUE);
|
|
||||||
gGameLegionOptions.LaptopLinkInsurance = iniReader.ReadBoolean("Laptop Settings","LINK_INSURANCE", FALSE);
|
|
||||||
gGameLegionOptions.LaptopLinkFuneral = iniReader.ReadBoolean("Laptop Settings","LINK_FUNERAL", TRUE);
|
|
||||||
gGameLegionOptions.LaptopLinkBobby = iniReader.ReadBoolean("Laptop Settings","LINK_BOBBY", FALSE);
|
|
||||||
gGameLegionOptions.fBobbyRSite = iniReader.ReadBoolean("Laptop Settings","BOBBY_SITE_ACCESSED", FALSE);
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
#ifndef _LEGION_CFG_H
|
|
||||||
#define _LEGION_CFG_H
|
|
||||||
|
|
||||||
#include "soldier profile type.h"
|
|
||||||
|
|
||||||
extern void LoadGameLegionOptions();
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
BOOLEAN BorderTown;
|
|
||||||
BOOLEAN BorderMine;
|
|
||||||
BOOLEAN BorderTeams;
|
|
||||||
BOOLEAN BorderMilitia;
|
|
||||||
BOOLEAN BorderAirspace;
|
|
||||||
BOOLEAN BorderItem;
|
|
||||||
|
|
||||||
BOOLEAN EnemyXML;
|
|
||||||
BOOLEAN EventAttackInitialSectorIfPlayerStillThere;
|
|
||||||
BOOLEAN HandleAddingEnemiesToTunnelMaps;
|
|
||||||
BOOLEAN BobbyRayInventory_UB;
|
|
||||||
BOOLEAN InitTownLoyalty_UB;
|
|
||||||
BOOLEAN AutoResolove;
|
|
||||||
BOOLEAN AddRandomEnemyToSector;
|
|
||||||
BOOLEAN StrategicMovementCostsXML;
|
|
||||||
BOOLEAN MakeStrategicMovementCosts;
|
|
||||||
BOOLEAN MercStartingGear25XML;
|
|
||||||
UINT32 InitialHeliGridNo[ 7 ];
|
|
||||||
INT16 InitalHeliRandomTimes[ 7 ];
|
|
||||||
UINT32 LOCATEGRIDNO;
|
|
||||||
BOOLEAN LaptopIMPPassJA2;
|
|
||||||
BOOLEAN LaptopIMPPassUB;
|
|
||||||
|
|
||||||
UINT8 ubDefaultArrivalSectorX;
|
|
||||||
UINT8 ubDefaultArrivalSectorY;
|
|
||||||
|
|
||||||
INT32 iStartingCashNovice;
|
|
||||||
INT32 iStartingCashExperienced;
|
|
||||||
INT32 iStartingCashExpert;
|
|
||||||
INT32 iStartingCashInsane;
|
|
||||||
|
|
||||||
BOOLEAN TEX_AND_JOHN;
|
|
||||||
|
|
||||||
BOOLEAN Random_Manuel_Text;
|
|
||||||
|
|
||||||
BOOLEAN RISRAPORT;
|
|
||||||
|
|
||||||
BOOLEAN LaptopQuestEnabled;
|
|
||||||
|
|
||||||
BOOLEAN InGameHeliCrash;
|
|
||||||
|
|
||||||
BOOLEAN InGameHeli;
|
|
||||||
|
|
||||||
UINT32 LOCATEGRIDNO2;
|
|
||||||
|
|
||||||
BOOLEAN JerryQuotes;
|
|
||||||
|
|
||||||
BOOLEAN InJerry;
|
|
||||||
|
|
||||||
UINT32 JerryGridNo;
|
|
||||||
|
|
||||||
UINT32 SwitchInMorrisAreaGridNo;
|
|
||||||
UINT32 SwitchToLaunchMisslesGridNo1;
|
|
||||||
UINT32 SwitchToLaunchMisslesGridNo2;
|
|
||||||
UINT32 RadioLocatorsGridNo1;
|
|
||||||
UINT32 RadioLocatorsGridNo2;
|
|
||||||
UINT32 PowergenSectorGridNo1;
|
|
||||||
UINT32 PowergenSectorGridNo2;
|
|
||||||
UINT32 PowergenSectorGridNo3;
|
|
||||||
UINT32 PowergenSectorGridNo4;
|
|
||||||
UINT32 PowergenSectorExitgridGridNo;
|
|
||||||
UINT32 PowergenFanSoundGridNo1;
|
|
||||||
UINT32 PowergenFanSoundGridNo2;
|
|
||||||
UINT32 StartFanbackupAgainGridNo;
|
|
||||||
UINT32 StopPowergenFanGridNo;
|
|
||||||
|
|
||||||
BOOLEAN TestUB;
|
|
||||||
|
|
||||||
BOOLEAN LaptopLinkInsurance;
|
|
||||||
BOOLEAN LaptopLinkFuneral;
|
|
||||||
BOOLEAN LaptopLinkBobby;
|
|
||||||
|
|
||||||
UINT32 FanGridNo[9];
|
|
||||||
|
|
||||||
UINT8 ubEndDefaultSectorX;
|
|
||||||
UINT8 ubEndDefaultSectorY;
|
|
||||||
UINT8 ubEndDefaultSectorZ;
|
|
||||||
|
|
||||||
BOOLEAN pJA2UB;
|
|
||||||
|
|
||||||
BOOLEAN fBobbyRSite;
|
|
||||||
BOOLEAN fDeadMerc;
|
|
||||||
|
|
||||||
BOOLEAN OLDUBInventory;
|
|
||||||
|
|
||||||
} GAME_LEGION_OPTIONS;
|
|
||||||
|
|
||||||
extern GAME_LEGION_OPTIONS gGameLegionOptions;
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
|
||||||
extern void RandomAddEnemy( UINT8 SectorX, UINT8 SectorY, UINT8 Level );
|
|
||||||
extern void RandomStats ();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern void RandomStats ();
|
|
||||||
#endif
|
|
||||||
@@ -201,6 +201,16 @@ void LoadGameUBOptions()
|
|||||||
|
|
||||||
gGameUBOptions.EventAttackInitialSectorIfPlayerStillThere = iniReader.ReadBoolean("Unfinished Business Settings","EVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE", TRUE);
|
gGameUBOptions.EventAttackInitialSectorIfPlayerStillThere = iniReader.ReadBoolean("Unfinished Business Settings","EVENT_ATTACK_INITIAL_SECTOR_IF_PLAYER_STILL_THERE", TRUE);
|
||||||
gGameUBOptions.HandleAddingEnemiesToTunnelMaps = iniReader.ReadBoolean("Unfinished Business Settings","HANDLE_ADDING_ENEMIES_TO_TUNNEL_MAPS", TRUE);
|
gGameUBOptions.HandleAddingEnemiesToTunnelMaps = iniReader.ReadBoolean("Unfinished Business Settings","HANDLE_ADDING_ENEMIES_TO_TUNNEL_MAPS", TRUE);
|
||||||
|
|
||||||
|
//J14-1
|
||||||
|
gGameUBOptions.Tunnel1_SectorX = iniReader.ReadInteger("Unfinished Business Settings", "TUNNEL1_SECTOR_X", 14);
|
||||||
|
gGameUBOptions.Tunnel1_SectorY = iniReader.ReadInteger("Unfinished Business Settings", "TUNNEL1_SECTOR_Y", 10);
|
||||||
|
gGameUBOptions.Tunnel1_SectorZ = iniReader.ReadInteger("Unfinished Business Settings", "TUNNEL1_SECTOR_Z", 1);
|
||||||
|
//K14-1
|
||||||
|
gGameUBOptions.Tunnel2_SectorX = iniReader.ReadInteger("Unfinished Business Settings", "TUNNEL2_SECTOR_X", 14);
|
||||||
|
gGameUBOptions.Tunnel2_SectorY = iniReader.ReadInteger("Unfinished Business Settings", "TUNNEL2_SECTOR_Y", 11);
|
||||||
|
gGameUBOptions.Tunnel2_SectorZ = iniReader.ReadInteger("Unfinished Business Settings", "TUNNEL2_SECTOR_Z", 1);
|
||||||
|
|
||||||
gGameUBOptions.ubEndDefaultSectorX = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_X", 16, 1, 16);
|
gGameUBOptions.ubEndDefaultSectorX = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_X", 16, 1, 16);
|
||||||
gGameUBOptions.ubEndDefaultSectorY = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_Y", 11, 1, 16);
|
gGameUBOptions.ubEndDefaultSectorY = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_Y", 11, 1, 16);
|
||||||
gGameUBOptions.ubEndDefaultSectorZ = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_Z", 0, 0, 16);
|
gGameUBOptions.ubEndDefaultSectorZ = iniReader.ReadInteger("Unfinished Business Settings","DEFAULT_END_SECTOR_Z", 0, 0, 16);
|
||||||
|
|||||||
@@ -224,6 +224,14 @@ typedef struct
|
|||||||
INT16 BettyBloodCatSectorX;
|
INT16 BettyBloodCatSectorX;
|
||||||
INT16 BettyBloodCatSectorY;
|
INT16 BettyBloodCatSectorY;
|
||||||
INT8 BettyBloodCatSectorZ;
|
INT8 BettyBloodCatSectorZ;
|
||||||
|
|
||||||
|
INT16 Tunnel1_SectorX;
|
||||||
|
INT16 Tunnel1_SectorY;
|
||||||
|
INT8 Tunnel1_SectorZ;
|
||||||
|
|
||||||
|
INT16 Tunnel2_SectorX;
|
||||||
|
INT16 Tunnel2_SectorY;
|
||||||
|
INT8 Tunnel2_SectorZ;
|
||||||
} GAME_UB_OPTIONS;
|
} GAME_UB_OPTIONS;
|
||||||
|
|
||||||
extern GAME_UB_OPTIONS gGameUBOptions;
|
extern GAME_UB_OPTIONS gGameUBOptions;
|
||||||
|
|||||||
+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;
|
||||||
|
|||||||
+21
-11
@@ -565,25 +565,35 @@ BOOLEAN CPostalService::DeliverShipment(UINT16 usShipmentID)
|
|||||||
|
|
||||||
StopTimeCompression();
|
StopTimeCompression();
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
|
|
||||||
//no UB
|
|
||||||
if ( gGameUBOptions.fBobbyRSite == TRUE )
|
if ( gGameUBOptions.fBobbyRSite == TRUE )
|
||||||
{
|
{
|
||||||
// Shipment from Bobby Ray
|
// Shipment from Bobby Ray
|
||||||
if (shs.sSenderID == BOBBYR_SENDER_ID)
|
if ( shs.sSenderID == BOBBYR_SENDER_ID )
|
||||||
AddBobbyREmailJA2( 198, 4, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_BOBBY_R_EMAIL_JA2_EDT);
|
{
|
||||||
|
if ( gEmails.size() > 0 )
|
||||||
|
{
|
||||||
|
AddEmailFromXML(XML_BR_SHIPMENTARRIVAL, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, false, -1, -1, 198, -1, -1, -1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AddBobbyREmailJA2(198, 4, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_BOBBY_R_EMAIL_JA2_EDT);
|
||||||
// Shipment from John Kulba
|
// Shipment from John Kulba
|
||||||
//else
|
//else
|
||||||
// AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
|
// AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
// Shipment from Bobby Ray
|
||||||
// Shipment from Bobby Ray
|
if ( shs.sSenderID == BOBBYR_SENDER_ID )
|
||||||
if (shs.sSenderID == BOBBYR_SENDER_ID)
|
{
|
||||||
AddEmail( BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
|
AddEmail(BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT, XML_BR_SHIPMENTARRIVAL);
|
||||||
// Shipment from John Kulba
|
}
|
||||||
else
|
// Shipment from John Kulba
|
||||||
AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
|
else
|
||||||
|
{
|
||||||
|
AddEmail(JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT, XML_JOHNKULBA_SENTGUNS);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+154
-245
@@ -1,295 +1,204 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "Debug Control.h"
|
#include "Debug Control.h"
|
||||||
#include "expat.h"
|
#include "expat.h"
|
||||||
#include "XML.h"
|
#include "XML.h"
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
#include "email.h"
|
#include "email.h"
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
PARSE_STAGE curElement;
|
PARSE_STAGE curElement;
|
||||||
|
|
||||||
CHAR8 szCharData[MAIL_STRING_SIZE+1];
|
CHAR8 szCharData[MAIL_STRING_SIZE + 1];
|
||||||
EMAIL_OTHER_VALUES curEmailOther;
|
CHAR16 currentMessage[MAIL_STRING_SIZE];
|
||||||
|
UINT16 currentEmailIndex;
|
||||||
|
UINT16 currentMessageIndex;
|
||||||
|
|
||||||
UINT32 maxArraySize;
|
UINT32 maxArraySize;
|
||||||
UINT32 curIndex;
|
UINT32 curIndex;
|
||||||
UINT32 currentDepth;
|
UINT32 currentDepth;
|
||||||
UINT32 maxReadDepth;
|
UINT32 maxReadDepth;
|
||||||
}
|
} typedef EmailXMLParseData;
|
||||||
|
|
||||||
typedef EmailOtherParseData;
|
BOOLEAN Emails_TextOnly;
|
||||||
|
|
||||||
BOOLEAN EmailOther_TextOnly;
|
|
||||||
|
|
||||||
static void XMLCALL
|
static void XMLCALL
|
||||||
EmailOtherStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
|
EmailOtherStartElementHandle(void* userData, const XML_Char* name, const XML_Char** atts)
|
||||||
{
|
{
|
||||||
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
|
EmailXMLParseData* pData = (EmailXMLParseData*)userData;
|
||||||
|
|
||||||
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
if (pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||||
{
|
{
|
||||||
if(strcmp(name, "NEW_EMAIL") == 0 && pData->curElement == ELEMENT_NONE)
|
if (strcmp(name, "EMAILS") == 0 && pData->curElement == ELEMENT_NONE)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT_LIST;
|
pData->curElement = ELEMENT_LIST;
|
||||||
|
|
||||||
pData->maxReadDepth++; //we are not skipping this element
|
pData->maxReadDepth++; //we are not skipping this element
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "EMAIL") == 0 && pData->curElement == ELEMENT_LIST)
|
else if (strcmp(name, "EMAIL") == 0 && pData->curElement == ELEMENT_LIST)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
|
|
||||||
pData->maxReadDepth++; //we are not skipping this element
|
pData->maxReadDepth++; //we are not skipping this element
|
||||||
}
|
}
|
||||||
else if(pData->curElement == ELEMENT &&
|
else if (pData->curElement == ELEMENT &&
|
||||||
(strcmp(name, "uiIndex") == 0 ||
|
(strcmp(name, "Index") == 0 ||
|
||||||
strcmp(name, "Subject") == 0 ||
|
strcmp(name, "Sender") == 0 ||
|
||||||
strcmp(name, "Message0") == 0 ||
|
strcmp(name, "Subject") == 0 ||
|
||||||
strcmp(name, "Message1") == 0 ||
|
strcmp(name, "Message") == 0))
|
||||||
strcmp(name, "Message2") == 0 ||
|
{
|
||||||
strcmp(name, "Message3") == 0 ||
|
pData->curElement = ELEMENT_PROPERTY;
|
||||||
strcmp(name, "Message4") == 0 ||
|
|
||||||
strcmp(name, "Message5") == 0 ||
|
|
||||||
strcmp(name, "Message6") == 0 ||
|
|
||||||
strcmp(name, "Message7") == 0 ||
|
|
||||||
strcmp(name, "Message8") == 0 ||
|
|
||||||
strcmp(name, "Message9") == 0 ||
|
|
||||||
strcmp(name, "Message10") == 0 ||
|
|
||||||
strcmp(name, "Message11") == 0 ||
|
|
||||||
strcmp(name, "Message12") == 0 ||
|
|
||||||
strcmp(name, "Message13") == 0 ||
|
|
||||||
strcmp(name, "Message14") == 0 ||
|
|
||||||
strcmp(name, "Message15") == 0 ||
|
|
||||||
strcmp(name, "Message16") == 0 ||
|
|
||||||
strcmp(name, "Message17") == 0 ||
|
|
||||||
strcmp(name, "Message18") == 0 ||
|
|
||||||
strcmp(name, "Message19") == 0 ||
|
|
||||||
strcmp(name, "Message20") == 0 ||
|
|
||||||
strcmp(name, "Message21") == 0 ||
|
|
||||||
strcmp(name, "Message22") == 0 ||
|
|
||||||
strcmp(name, "Message23") == 0 ||
|
|
||||||
strcmp(name, "Message24") == 0 ||
|
|
||||||
strcmp(name, "Message25") == 0 ||
|
|
||||||
strcmp(name, "Message26") == 0 ||
|
|
||||||
strcmp(name, "Message27") == 0 ||
|
|
||||||
strcmp(name, "Message28") == 0 ||
|
|
||||||
strcmp(name, "Message29") == 0 ))
|
|
||||||
{
|
|
||||||
pData->curElement = ELEMENT_PROPERTY;
|
|
||||||
|
|
||||||
pData->maxReadDepth++; //we are not skipping this element
|
pData->maxReadDepth++; //we are not skipping this element
|
||||||
}
|
}
|
||||||
|
|
||||||
pData->szCharData[0] = '\0';
|
pData->szCharData[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
pData->currentDepth++;
|
pData->currentDepth++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void XMLCALL
|
static void XMLCALL
|
||||||
EmailOtherCharacterDataHandle(void *userData, const XML_Char *str, int len)
|
EmailOtherCharacterDataHandle(void* userData, const XML_Char* str, int len)
|
||||||
{
|
{
|
||||||
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
|
EmailXMLParseData* pData = (EmailXMLParseData*)userData;
|
||||||
|
|
||||||
if( (pData->currentDepth <= pData->maxReadDepth) &&
|
if ((pData->currentDepth <= pData->maxReadDepth) &&
|
||||||
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
|
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
|
||||||
){
|
) {
|
||||||
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
|
strncat(pData->szCharData, str, __min((unsigned int)len, MAX_CHAR_DATA_LENGTH - strlen(pData->szCharData)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void XMLCALL
|
static void XMLCALL
|
||||||
EmailOtherEndElementHandle(void *userData, const XML_Char *name)
|
EmailOtherEndElementHandle(void* userData, const XML_Char* name)
|
||||||
{
|
{
|
||||||
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
|
EmailXMLParseData* pData = (EmailXMLParseData*)userData;
|
||||||
|
|
||||||
if(pData->currentDepth <= pData->maxReadDepth)
|
if (pData->currentDepth <= pData->maxReadDepth)
|
||||||
{
|
{
|
||||||
if(strcmp(name, "NEW_EMAIL") == 0)
|
if (strcmp(name, "EMAILS") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT_NONE;
|
pData->curElement = ELEMENT_NONE;
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "EMAIL") == 0)
|
else if (strcmp(name, "EMAIL") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT_LIST;
|
pData->curElement = ELEMENT_LIST;
|
||||||
|
if ( Emails_TextOnly )
|
||||||
|
{
|
||||||
|
pData->currentEmailIndex += 1;
|
||||||
|
pData->currentMessageIndex = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strcmp(name, "Sender") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
if ( !Emails_TextOnly )
|
||||||
|
{
|
||||||
|
gEmails.push_back(EMAIL_XML {});
|
||||||
|
gEmails.back().Sender = atol(pData->szCharData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strcmp(name, "Subject") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
if ( !Emails_TextOnly )
|
||||||
|
{
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, pData->szCharData, -1, gEmails.back().Subject, sizeof(gEmails.back().Subject) / sizeof(gEmails.back().Subject[0]));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Replace existing text with localized version
|
||||||
|
const auto i = pData->currentEmailIndex;
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, pData->szCharData, -1, gEmails[i].Subject, sizeof(gEmails[i].Subject) / sizeof(gEmails[i].Subject[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strcmp(name, "Message") == 0)
|
||||||
|
{
|
||||||
|
pData->curElement = ELEMENT;
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, pData->szCharData, -1, pData->currentMessage, sizeof(pData->currentMessage) / sizeof(pData->currentMessage[0]));
|
||||||
|
|
||||||
if (!EmailOther_TextOnly)
|
if ( !Emails_TextOnly )
|
||||||
{
|
{
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szSubject, pData->curEmailOther.szSubject);
|
gEmails.back().Messages.emplace_back(pData->currentMessage);
|
||||||
// L"12345678901234567890123456789" <- max lenght (szMessage[30])
|
}
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[0], L"1. sdssdsfs dfg fdgd fg test" ); //pData-curEmailOther.szMessage[0]);
|
else
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], L"2. sdssdsfs dfg fgfgffds test" );
|
{
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], L"3. sdssdsfsd gdfg fdfgsf test" );
|
// Replace existing text with localized version
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], L"4. sdssdsf dgdfg dgsfdsf test" );
|
const auto i = pData->currentEmailIndex;
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], L"5. sdssdsfdgdfg dgfddsf test" );
|
const auto j = pData->currentMessageIndex;
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], L"6. sdssdsfsffdsf test" );
|
gEmails[i].Messages[j] = pData->currentMessage;
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], L"7. sdssdsfsffdsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], L"8. sdssdsfsfdgdgfgfdsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], L"9. sdssdsfsff dg gdg dsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], L"10. sdssdsfsfgdsgdfgfdsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], L"11. sdssdsfsff dgfgd dsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], L"12. sdssdsfsf dfgdfg dsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], L"13. sdssdsfsf dfgg gfdsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], L"14. sdssdsf dgdf gsffdsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], L"15. sdssdsf dgdf f ffdsf test" );
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], L"16. sdssdsfs dgdf gffdsf test" );
|
|
||||||
|
|
||||||
/*
|
pData->currentMessageIndex++;
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], pData->curEmailOther.szMessage[1]);
|
}
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], pData->curEmailOther.szMessage[2]);
|
}
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], pData->curEmailOther.szMessage[3]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], pData->curEmailOther.szMessage[4]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], pData->curEmailOther.szMessage[5]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], pData->curEmailOther.szMessage[6]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], pData->curEmailOther.szMessage[7]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], pData->curEmailOther.szMessage[8]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], pData->curEmailOther.szMessage[9]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], pData->curEmailOther.szMessage[10]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], pData->curEmailOther.szMessage[11]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], pData->curEmailOther.szMessage[12]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], pData->curEmailOther.szMessage[13]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], pData->curEmailOther.szMessage[14]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], pData->curEmailOther.szMessage[15]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[16], pData->curEmailOther.szMessage[16]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[17], pData->curEmailOther.szMessage[17]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[18], pData->curEmailOther.szMessage[18]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[19], pData->curEmailOther.szMessage[19]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[20], pData->curEmailOther.szMessage[20]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[21], pData->curEmailOther.szMessage[21]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[22], pData->curEmailOther.szMessage[22]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[23], pData->curEmailOther.szMessage[23]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[24], pData->curEmailOther.szMessage[24]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[25], pData->curEmailOther.szMessage[25]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[26], pData->curEmailOther.szMessage[26]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[27], pData->curEmailOther.szMessage[27]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[28], pData->curEmailOther.szMessage[28]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[29], pData->curEmailOther.szMessage[29]);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szSubject, pData->curEmailOther.szSubject);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[0], L"sdssdsfsffdsf test" ); //pData->curEmailOther.szMessage[0]);
|
|
||||||
/*
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], pData->curEmailOther.szMessage[1]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], pData->curEmailOther.szMessage[2]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], pData->curEmailOther.szMessage[3]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], pData->curEmailOther.szMessage[4]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], pData->curEmailOther.szMessage[5]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], pData->curEmailOther.szMessage[6]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], pData->curEmailOther.szMessage[7]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], pData->curEmailOther.szMessage[8]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], pData->curEmailOther.szMessage[9]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], pData->curEmailOther.szMessage[10]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], pData->curEmailOther.szMessage[11]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], pData->curEmailOther.szMessage[12]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], pData->curEmailOther.szMessage[13]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], pData->curEmailOther.szMessage[14]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], pData->curEmailOther.szMessage[15]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[16], pData->curEmailOther.szMessage[16]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[17], pData->curEmailOther.szMessage[17]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[18], pData->curEmailOther.szMessage[18]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[19], pData->curEmailOther.szMessage[19]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[20], pData->curEmailOther.szMessage[20]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[21], pData->curEmailOther.szMessage[21]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[22], pData->curEmailOther.szMessage[22]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[23], pData->curEmailOther.szMessage[23]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[24], pData->curEmailOther.szMessage[24]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[25], pData->curEmailOther.szMessage[25]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[26], pData->curEmailOther.szMessage[26]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[27], pData->curEmailOther.szMessage[27]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[28], pData->curEmailOther.szMessage[28]);
|
|
||||||
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[29], pData->curEmailOther.szMessage[29]);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(strcmp(name, "uiIndex") == 0)
|
|
||||||
{
|
|
||||||
pData->curElement = ELEMENT;
|
|
||||||
pData->curEmailOther.uiIndex = (UINT8) atol(pData->szCharData);
|
|
||||||
}
|
|
||||||
else if(strcmp(name, "Subject") == 0 )
|
|
||||||
{
|
|
||||||
pData->curElement = ELEMENT;
|
|
||||||
|
|
||||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailOther.szSubject, sizeof(pData->curEmailOther.szSubject)/sizeof(pData->curEmailOther.szSubject[0]) );
|
pData->maxReadDepth--;
|
||||||
pData->curEmailOther.szSubject[sizeof(pData->curEmailOther.szSubject)/sizeof(pData->curEmailOther.szSubject[0]) - 1] = '\0';
|
}
|
||||||
}
|
pData->currentDepth--;
|
||||||
/*
|
|
||||||
else if(strcmp(name, "Message0") == 0 )
|
|
||||||
{
|
|
||||||
pData->curElement = ELEMENT;
|
|
||||||
|
|
||||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailOther.szMessage[0], sizeof(pData->curEmailOther.szMessage[0])/sizeof(pData->curEmailOther.szMessage[0]) );
|
|
||||||
pData->curEmailOther.szMessage[sizeof(pData->curEmailOther.szMessage[0])/sizeof(pData->curEmailOther.szMessage[0]) - 1][0] = '\0';
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
pData->maxReadDepth--;
|
|
||||||
}
|
|
||||||
pData->currentDepth--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN ReadInEmailOther(STR fileName, BOOLEAN localizedVersion)
|
BOOLEAN ReadInExternalizedEmails(STR fileName, BOOLEAN localizedVersion)
|
||||||
{
|
{
|
||||||
HWFILE hFile;
|
HWFILE hFile;
|
||||||
UINT32 uiBytesRead;
|
UINT32 uiBytesRead;
|
||||||
UINT32 uiFSize;
|
UINT32 uiFSize;
|
||||||
CHAR8 * lpcBuffer;
|
CHAR8* lpcBuffer;
|
||||||
XML_Parser parser = XML_ParserCreate(NULL);
|
XML_Parser parser = XML_ParserCreate(NULL);
|
||||||
|
|
||||||
EmailOtherParseData pData;
|
EmailXMLParseData pData;
|
||||||
|
|
||||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailOther.xml" );
|
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading Emails.xml");
|
||||||
|
|
||||||
EmailOther_TextOnly = localizedVersion;
|
Emails_TextOnly = localizedVersion;
|
||||||
|
|
||||||
// Open file
|
// Open file
|
||||||
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
|
hFile = FileOpen(fileName, FILE_ACCESS_READ, FALSE);
|
||||||
if ( !hFile )
|
if (!hFile)
|
||||||
return( localizedVersion );
|
return(localizedVersion);
|
||||||
|
|
||||||
uiFSize = FileGetSize(hFile);
|
uiFSize = FileGetSize(hFile);
|
||||||
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
|
lpcBuffer = (CHAR8*)MemAlloc(uiFSize + 1);
|
||||||
|
|
||||||
//Read in block
|
//Read in block
|
||||||
if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
|
if (!FileRead(hFile, lpcBuffer, uiFSize, &uiBytesRead))
|
||||||
{
|
{
|
||||||
MemFree(lpcBuffer);
|
MemFree(lpcBuffer);
|
||||||
return( FALSE );
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
lpcBuffer[uiFSize] = 0; //add a null terminator
|
lpcBuffer[uiFSize] = 0; //add a null terminator
|
||||||
|
|
||||||
FileClose( hFile );
|
FileClose(hFile);
|
||||||
|
|
||||||
|
|
||||||
XML_SetElementHandler(parser, EmailOtherStartElementHandle, EmailOtherEndElementHandle);
|
XML_SetElementHandler(parser, EmailOtherStartElementHandle, EmailOtherEndElementHandle);
|
||||||
XML_SetCharacterDataHandler(parser, EmailOtherCharacterDataHandle);
|
XML_SetCharacterDataHandler(parser, EmailOtherCharacterDataHandle);
|
||||||
|
|
||||||
|
|
||||||
memset(&pData,0,sizeof(pData));
|
memset(&pData, 0, sizeof(pData));
|
||||||
XML_SetUserData(parser, &pData);
|
XML_SetUserData(parser, &pData);
|
||||||
|
|
||||||
|
gEmails.reserve(XML_JA2UB_SPECK_DISMISSALREFUND);
|
||||||
|
if (!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
|
||||||
|
{
|
||||||
|
CHAR8 errorBuf[511];
|
||||||
|
|
||||||
|
sprintf(errorBuf, "XML Parser Error in Emails.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
|
||||||
|
LiveMessage(errorBuf);
|
||||||
|
|
||||||
|
MemFree(lpcBuffer);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
MemFree(lpcBuffer);
|
||||||
|
|
||||||
|
|
||||||
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
|
XML_ParserFree(parser);
|
||||||
{
|
|
||||||
CHAR8 errorBuf[511];
|
|
||||||
|
|
||||||
sprintf(errorBuf, "XML Parser Error in EmailOther.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
|
|
||||||
LiveMessage(errorBuf);
|
|
||||||
|
|
||||||
MemFree(lpcBuffer);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
MemFree(lpcBuffer);
|
|
||||||
|
|
||||||
|
|
||||||
XML_ParserFree(parser);
|
return(TRUE);
|
||||||
|
|
||||||
|
|
||||||
return( TRUE );
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -3,7 +3,6 @@
|
|||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "WCheck.h"
|
#include "WCheck.h"
|
||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "DEBUG.H"
|
|
||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "Encrypted File.h"
|
#include "Encrypted File.h"
|
||||||
#include "email.h"
|
#include "email.h"
|
||||||
@@ -16,7 +15,7 @@
|
|||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
|
|
||||||
#include "LocalizedStrings.h"
|
#include "LocalizedStrings.h"
|
||||||
#include "Soldier Profile.h"
|
#include <soldier profile type.h>
|
||||||
|
|
||||||
UINT8 MAX_NUMBER_MERCS = 0;
|
UINT8 MAX_NUMBER_MERCS = 0;
|
||||||
|
|
||||||
|
|||||||
+513
-513
File diff suppressed because it is too large
Load Diff
+97
-19
@@ -5,8 +5,7 @@
|
|||||||
#include "soldier profile type.h"
|
#include "soldier profile type.h"
|
||||||
|
|
||||||
// defines
|
// defines
|
||||||
#define MAX_EMAIL_LINES 10 //max number of lines can be shown in a message
|
#define MAX_MESSAGES_PAGE 18 // max number of emails per page in inbox
|
||||||
#define MAX_MESSAGES_PAGE 18 // max number of messages per page
|
|
||||||
|
|
||||||
//---ja25 ub
|
//---ja25 ub
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
@@ -567,11 +566,10 @@ void RenderEmail();
|
|||||||
|
|
||||||
|
|
||||||
// message manipulation
|
// message manipulation
|
||||||
void AddEmailMessage(INT32 iMessageOffset, INT32 iMessageLength,STR16 pSubject, INT32 iDate, UINT8 ubSender, BOOLEAN fAlreadyRead, INT32 uiFirstData, UINT32 uiSecondData, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType, UINT32 EmailAIM );
|
void AddEmailMessage(INT32 iMessageOffset, INT32 iMessageLength,STR16 pSubject, INT32 iDate, UINT8 ubSender, BOOLEAN fAlreadyRead, INT32 iFirstData, UINT32 uiSecondData, INT32 iThirdData, INT32 iFourthData, UINT32 uiFifthData, UINT32 uiSixData, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType, UINT32 EmailAIM );
|
||||||
void RemoveEmailMessage(INT32 iId);
|
void RemoveEmailMessage(INT32 iId);
|
||||||
EmailPtr GetEmailMessage(INT32 iId);
|
EmailPtr GetEmailMessage(INT32 iId);
|
||||||
void LookForUnread();
|
void LookForUnread();
|
||||||
void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType);
|
|
||||||
|
|
||||||
// WANNE: For the new WF merc, when they available again
|
// WANNE: For the new WF merc, when they available again
|
||||||
void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType);
|
void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType);
|
||||||
@@ -586,14 +584,19 @@ void ReDrawNewMailBox( void );
|
|||||||
void ReDisplayBoxes( void );
|
void ReDisplayBoxes( void );
|
||||||
void ShutDownEmailList();
|
void ShutDownEmailList();
|
||||||
void AddMessageToPages(INT32 iMessageId);
|
void AddMessageToPages(INT32 iMessageId);
|
||||||
void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailType, UINT32 EmailAIM );
|
|
||||||
|
|
||||||
void AddCustomEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType);
|
|
||||||
|
|
||||||
#ifdef JA2BETAVERSION
|
#ifdef JA2BETAVERSION
|
||||||
void AddAllEmails();
|
void AddAllEmails();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
UINT8 Sender;
|
||||||
|
CHAR16 Subject[EMAIL_SUBJECT_LENGTH];
|
||||||
|
std::vector<std::wstring> Messages;
|
||||||
|
} EMAIL_XML;
|
||||||
|
extern std::vector<EMAIL_XML> gEmails;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
UINT8 uiIndex;
|
UINT8 uiIndex;
|
||||||
@@ -674,8 +677,8 @@ enum {
|
|||||||
TYPE_EMAIL_KING_PIN,
|
TYPE_EMAIL_KING_PIN,
|
||||||
TYPE_EMAIL_JOHN_KULBA,
|
TYPE_EMAIL_JOHN_KULBA,
|
||||||
TYPE_EMAIL_AIM_SITE,
|
TYPE_EMAIL_AIM_SITE,
|
||||||
|
//Read message from Email\Emails.xml and sender read from Email\EmailSenderNameList.xml
|
||||||
TYPE_EMAIL_OTHER,
|
TYPE_EMAIL_XML,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -697,15 +700,96 @@ enum {
|
|||||||
TYPE_EMAIL_BOBBY_R_L1 = 11,
|
TYPE_EMAIL_BOBBY_R_L1 = 11,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
XML_NOEMAIL = -1,
|
||||||
|
XML_ENRICO_INQUIRY = 0,
|
||||||
|
XML_ENRICO_FOLLOWUP,
|
||||||
|
XML_ENRICO_CONFIRMED,
|
||||||
|
XML_ENRICO_GOODLUCK,
|
||||||
|
XML_ENRICO_GREATNEWS,
|
||||||
|
XML_ENRICO_PROGRESS,
|
||||||
|
XML_ENRICO_GOODWORK,
|
||||||
|
XML_ENRICO_FINALPUSH,
|
||||||
|
XML_ENRICO_SETBACK,
|
||||||
|
XML_ENRICO_BADNEWS,
|
||||||
|
XML_ENRICO_CREPITUS,
|
||||||
|
XML_ENRICO_CONCERNED,
|
||||||
|
XML_ENRICO_WORRIED,
|
||||||
|
XML_ENRICO_DISAPPOINTED,
|
||||||
|
XML_ENRICO_MILITIA_WEBSITE,
|
||||||
|
XML_ENRICO_INTEL,
|
||||||
|
XML_IMP_INTRO,
|
||||||
|
XML_IMP_INTROAGAIN,
|
||||||
|
XML_SPECK_INTRO,
|
||||||
|
XML_SPECK_NEWSITE,
|
||||||
|
XML_SPECK_NOTICE,
|
||||||
|
XML_SPECK_NEWPERSONNEL,
|
||||||
|
XML_SPECK_PLEASEPAY,
|
||||||
|
XML_SPECK_DELINQUENT,
|
||||||
|
XML_RISREPORT,
|
||||||
|
XML_INSURANCE_APPROVED,
|
||||||
|
XML_INSURANCE_SUSPICIOUS,
|
||||||
|
XML_INSURANCE_COMPLETED,
|
||||||
|
XML_INSURANCE_INVESTIGATION,
|
||||||
|
XML_INSURANCE_REFUSED,
|
||||||
|
XML_INSURANCE_POLICYVIOLATION,
|
||||||
|
XML_BR_VISITEDSITE,
|
||||||
|
XML_BR_SHIPMENTARRIVAL,
|
||||||
|
XML_BR_MEDUNA,
|
||||||
|
XML_KINGPIN_STOLEMONEY,
|
||||||
|
XML_KINGPIN_JOBOPPORTUNITY,
|
||||||
|
XML_KINGPIN_WELLDONE,
|
||||||
|
XML_KINGPIN_FAILURE,
|
||||||
|
XML_KINGPIN_FAILUREOBSTACLES,
|
||||||
|
XML_JOHNKULBA_SENTGUNS,
|
||||||
|
XML_JOHNKULBA_MISSEDTRANSFERFLIGHT,
|
||||||
|
XML_JOHNKULBA_CRASHLANDEDHELI,
|
||||||
|
XML_JOHNKULBA_AMBUSHEDBYCATS,
|
||||||
|
XML_AIM_NOTICE_OF_DEATH,
|
||||||
|
XML_AIM_REFUND,
|
||||||
|
XML_AIM_PARTIALREFUND,
|
||||||
|
XML_AIM_NOREFUND,
|
||||||
|
XML_KERBERUS_OFFER,
|
||||||
|
XML_DASILVA_THANKYOU,
|
||||||
|
XML_JA2UB_ENRICO_HELP,
|
||||||
|
XML_JA2UB_ENRICO_INQUIRY,
|
||||||
|
XML_JA2UB_ENRICO_STILLNOWORD,
|
||||||
|
XML_JA2UB_ENRICO_GOODNEWS,
|
||||||
|
XML_JA2UB_ENRICO_CONCERNED,
|
||||||
|
XML_JA2UB_ENRICO_URGENT,
|
||||||
|
XML_JA2UB_ENRICO_RECEIVEDEMAIL,
|
||||||
|
XML_JA2UB_ENRICO_RECEIVEDEMAILMONEY,
|
||||||
|
XML_JA2UB_ENRICO_PILOTFOUND,
|
||||||
|
XML_JA2UB_ENRICO_CONGRATS,
|
||||||
|
XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK,
|
||||||
|
XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK_MANUELDEAD,
|
||||||
|
XML_JA2UB_ENRICO_CONGRATS_MIGUELSICK_MANUELALIVE,
|
||||||
|
XML_JA2UB_ENRICO_CONGRATS_MANUELDEAD,
|
||||||
|
XML_JA2UB_ENRICO_CONGRATS_MANUELALIVE,
|
||||||
|
XML_JA2UB_IMP_INTRO,
|
||||||
|
XML_JA2UB_IMP_INTROAGAIN,
|
||||||
|
XML_JA2UB_MIGUEL_HELLO,
|
||||||
|
XML_JA2UB_MIGUEL_SORRY,
|
||||||
|
XML_JA2UB_MIGUEL_SORRY_HIREDMANUEL,
|
||||||
|
XML_JA2UB_MIGUEL_SICK,
|
||||||
|
XML_JA2UB_MIGUEL_CIGARETTES,
|
||||||
|
XML_JA2UB_AIM_SPECIALOFFER,
|
||||||
|
XML_JA2UB_AIM_BONUSOFFER,
|
||||||
|
XML_JA2UB_AIM_SPECIALBONUSOFFER,
|
||||||
|
XML_JA2UB_AIM_DISMISSALREFUND,
|
||||||
|
XML_JA2UB_SPECK_EVENBETTEROFFER,
|
||||||
|
XML_JA2UB_SPECK_DISMISSALREFUND
|
||||||
|
};
|
||||||
|
void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType, UINT16 EnumEmailXML = XML_NOEMAIL);
|
||||||
|
void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailType, UINT32 EmailAIM, UINT16 EnumEmailXML = XML_NOEMAIL);
|
||||||
|
|
||||||
extern EMAIL_MERC_AVAILABLE_VALUES EmailMercAvailableText[NUM_PROFILES];
|
extern EMAIL_MERC_AVAILABLE_VALUES EmailMercAvailableText[NUM_PROFILES];
|
||||||
extern EMAIL_MERC_LEVEL_UP_VALUES EmailMercLevelUpText[NUM_PROFILES];
|
extern EMAIL_MERC_LEVEL_UP_VALUES EmailMercLevelUpText[NUM_PROFILES];
|
||||||
extern EMAIL_MERC_INSURANCE_VALUES EmailInsuranceText[NUM_PROFILES];
|
|
||||||
|
|
||||||
extern EMAIL_OTHER_VALUES EmailOtherText[EMAIL_INDEX];
|
|
||||||
extern BOOLEAN ReadXMLEmail;
|
extern BOOLEAN ReadXMLEmail;
|
||||||
extern void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType );
|
extern void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType );
|
||||||
extern void AddPreReadEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, UINT8 EmailType );
|
extern void AddPreReadEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, UINT8 EmailType );
|
||||||
extern void AddEmailWithSpecialDataXML(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailTyp, UINT32 EmailAIMe );
|
extern void AddEmailFromXML(INT32 iMessageOffset, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, BOOLEAN alreadyRead, INT32 iFirstData, UINT32 uiSecondData, INT32 iThirdData, INT32 iFourthData, UINT32 uiFifthData, UINT32 uiSixData);
|
||||||
|
extern void AddEmailWithSpecialDataXML(INT32 iMessageOffset, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, BOOLEAN alreadyRead, INT32 iFirstData, UINT32 uiSecondData, INT32 iThirdData, INT32 iFourthData, UINT32 uiFifthData, UINT32 uiSixData);
|
||||||
extern BOOLEAN SaveNewEmailDataToSaveGameFile( HWFILE hFile );
|
extern BOOLEAN SaveNewEmailDataToSaveGameFile( HWFILE hFile );
|
||||||
extern BOOLEAN LoadNewEmailDataFromLoadGameFile( HWFILE hFile );
|
extern BOOLEAN LoadNewEmailDataFromLoadGameFile( HWFILE hFile );
|
||||||
|
|
||||||
@@ -714,9 +798,3 @@ extern void AddBobbyREmailJA2(INT32 iMessageOffset, INT32 iMessageLength, UINT8
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+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.
|
||||||
|
|||||||
+117
-112
@@ -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,9 +1348,10 @@ BOOLEAN AddLifeInsurancePayout( SOLDIERTYPE *pSoldier )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void StartInsuranceInvestigation( UINT8 ubPayoutID )
|
void StartInsuranceInvestigation( UINT16 ubPayoutID )
|
||||||
{
|
{
|
||||||
UINT8 ubDays;
|
const auto mercID = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID;
|
||||||
|
const auto payoutPrice = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].iPayOutPrice;
|
||||||
|
|
||||||
// send an email telling player an investigation is taking place
|
// send an email telling player an investigation is taking place
|
||||||
if (gStrategicStatus.ubInsuranceInvestigationsCnt == 0)
|
if (gStrategicStatus.ubInsuranceInvestigationsCnt == 0)
|
||||||
@@ -1368,10 +1362,12 @@ void StartInsuranceInvestigation( UINT8 ubPayoutID )
|
|||||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||||
{
|
{
|
||||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||||
AddEmailWithSpecialData( 173, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L4 );
|
{
|
||||||
|
AddEmailWithSpecialData(173, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L4, XML_INSURANCE_SUSPICIOUS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
AddEmailWithSpecialData( INSUR_SUSPIC, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(INSUR_SUSPIC, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_SUSPICIOUS);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1382,14 +1378,17 @@ void StartInsuranceInvestigation( UINT8 ubPayoutID )
|
|||||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||||
{
|
{
|
||||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||||
AddEmailWithSpecialData( 179, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L5 );
|
{
|
||||||
|
AddEmailWithSpecialData(179, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L5, XML_INSURANCE_INVESTIGATION);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
AddEmailWithSpecialData( INSUR_SUSPIC_2, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(INSUR_SUSPIC_2, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_INVESTIGATION);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
|
UINT8 ubDays;
|
||||||
|
if ( gMercProfiles[ mercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
|
||||||
{
|
{
|
||||||
// the fact that you tried to cheat them gets realized very quickly. :-)
|
// the fact that you tried to cheat them gets realized very quickly. :-)
|
||||||
ubDays = 1;
|
ubDays = 1;
|
||||||
@@ -1408,44 +1407,49 @@ void StartInsuranceInvestigation( UINT8 ubPayoutID )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EndInsuranceInvestigation( UINT8 ubPayoutID )
|
void EndInsuranceInvestigation( UINT16 ubPayoutID )
|
||||||
{
|
{
|
||||||
|
const auto mercID = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID;
|
||||||
|
const auto payoutPrice = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].iPayOutPrice;
|
||||||
|
|
||||||
// send an email telling player the investigation is over
|
// send an email telling player the investigation is over
|
||||||
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
|
if ( gMercProfiles[ mercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
|
||||||
{
|
{
|
||||||
// fraud, no payout!
|
// fraud, no payout!
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
// no UB
|
if ( gubQuest[QUEST_FIX_LAPTOP] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
{
|
||||||
{
|
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
{
|
||||||
AddEmailWithSpecialData( INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L2 );
|
AddEmailWithSpecialData(INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L2, XML_INSURANCE_REFUSED);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
AddEmailWithSpecialData( INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_REFUSED);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
// Flugente: also don't pay out if the death was suspicious. I mean, we get this if there were no enemies of the player straight up shot the guy...
|
// Flugente: also don't pay out if the death was suspicious. I mean, we get this if there were no enemies of the player straight up shot the guy...
|
||||||
else if ( gMercProfiles[LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID].ubSuspiciousDeath == SUSPICIOUS_DEATH )
|
else if ( gMercProfiles[mercID].ubSuspiciousDeath == SUSPICIOUS_DEATH )
|
||||||
{
|
{
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
// WANNE: I really don't know if we should call something here. At least it fixed the compilation error when compiling UB version.
|
// WANNE: I really don't know if we should call something here. At least it fixed the compilation error when compiling UB version.
|
||||||
#else
|
#else
|
||||||
// fraud, no payout!
|
// fraud, no payout!
|
||||||
AddEmailWithSpecialData( INSUR_CHEAT_FRAUD, INSUR_CHEAT_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(INSUR_CHEAT_FRAUD, INSUR_CHEAT_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_POLICYVIOLATION);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
// No UB
|
|
||||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||||
{
|
{
|
||||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||||
AddEmailWithSpecialData( 176, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L6 );
|
{
|
||||||
|
AddEmailWithSpecialData(176, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L6, XML_INSURANCE_COMPLETED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
AddEmailWithSpecialData( INSUR_INVEST_OVER, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(INSUR_INVEST_OVER, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_COMPLETED);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// only now make a payment (immediately)
|
// only now make a payment (immediately)
|
||||||
@@ -1455,35 +1459,39 @@ void EndInsuranceInvestigation( UINT8 ubPayoutID )
|
|||||||
|
|
||||||
|
|
||||||
//void InsuranceContractPayLifeInsuranceForDeadMerc( LIFE_INSURANCE_PAYOUT *pPayoutStruct )
|
//void InsuranceContractPayLifeInsuranceForDeadMerc( LIFE_INSURANCE_PAYOUT *pPayoutStruct )
|
||||||
void InsuranceContractPayLifeInsuranceForDeadMerc( UINT8 ubPayoutID )
|
void InsuranceContractPayLifeInsuranceForDeadMerc( UINT16 ubPayoutID )
|
||||||
{
|
{
|
||||||
|
const auto mercID = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].ubMercID;
|
||||||
|
const auto payoutPrice = LaptopSaveInfo.pLifeInsurancePayouts[ubPayoutID].iPayOutPrice;
|
||||||
|
|
||||||
//if the mercs id number is the same what is in the soldier array
|
//if 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
|
||||||
AddTransactionToPlayersBook( INSURANCE_PAYOUT, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice );
|
AddTransactionToPlayersBook( INSURANCE_PAYOUT, mercID, GetWorldTotalMin(), payoutPrice );
|
||||||
|
|
||||||
//add to the history log the fact that the we paid the insurance claim
|
//add to the history log the fact that the we paid the insurance claim
|
||||||
AddHistoryToPlayersLog( HISTORY_INSURANCE_CLAIM_PAYOUT, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, GetWorldTotalMin(), -1, -1 );
|
AddHistoryToPlayersLog( HISTORY_INSURANCE_CLAIM_PAYOUT, mercID, GetWorldTotalMin(), -1, -1 );
|
||||||
|
|
||||||
//if there WASNT an investigation
|
//if there WASNT an investigation
|
||||||
if( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == 0 )
|
if( gMercProfiles[ mercID ].ubSuspiciousDeath == 0 )
|
||||||
{
|
{
|
||||||
//Add an email telling the user that he received an insurance payment
|
//Add an email telling the user that he received an insurance payment
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
// no UB
|
|
||||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||||
{
|
{
|
||||||
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
|
||||||
AddEmailWithSpecialData( 170, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L3 );
|
{
|
||||||
|
AddEmailWithSpecialData(170, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L3, XML_INSURANCE_APPROVED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
AddEmailWithSpecialData( INSUR_PAYMENT, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(INSUR_PAYMENT, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), payoutPrice, mercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_INSURANCE_APPROVED);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1552,14 +1560,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 +1789,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 );
|
||||||
|
|
||||||
|
|||||||
+11
-28
@@ -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 )
|
||||||
{
|
{
|
||||||
@@ -3300,7 +3294,7 @@ void HaventMadeImpMercEmailCallBack()
|
|||||||
if( ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) && ( LaptopSaveInfo.fSentImpWarningAlready == FALSE ) )
|
if( ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) && ( LaptopSaveInfo.fSentImpWarningAlready == FALSE ) )
|
||||||
{
|
{
|
||||||
LaptopSaveInfo.fSentImpWarningAlready = TRUE;
|
LaptopSaveInfo.fSentImpWarningAlready = TRUE;
|
||||||
AddEmail(IMP_EMAIL_AGAIN,IMP_EMAIL_AGAIN_LENGTH,1, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
AddEmail(IMP_EMAIL_AGAIN,IMP_EMAIL_AGAIN_LENGTH,1, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_IMP_INTROAGAIN);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -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 ) )
|
||||||
@@ -1038,7 +1039,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
|||||||
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_INVALID;
|
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_INVALID;
|
||||||
if( IsSpeckComAvailable() )
|
if( IsSpeckComAvailable() )
|
||||||
{
|
{
|
||||||
AddEmail( MERC_INVALID, MERC_INVALID_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
AddEmail(MERC_INVALID, MERC_INVALID_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_NOTICE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1054,7 +1055,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
|||||||
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_SUSPENDED;
|
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_SUSPENDED;
|
||||||
if( IsSpeckComAvailable() )
|
if( IsSpeckComAvailable() )
|
||||||
{
|
{
|
||||||
AddEmail( MERC_WARNING, MERC_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
AddEmail(MERC_WARNING, MERC_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_DELINQUENT);
|
||||||
|
|
||||||
// Have speck complain next time player come to site
|
// Have speck complain next time player come to site
|
||||||
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
|
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
|
||||||
@@ -1073,7 +1074,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
|
|||||||
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_VALID_FIRST_WARNING;
|
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_VALID_FIRST_WARNING;
|
||||||
if( IsSpeckComAvailable() )
|
if( IsSpeckComAvailable() )
|
||||||
{
|
{
|
||||||
AddEmail( MERC_FIRST_WARNING, MERC_FIRST_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
AddEmail(MERC_FIRST_WARNING, MERC_FIRST_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_PLEASEPAY);
|
||||||
|
|
||||||
// Have speck complain next time player come to site
|
// Have speck complain next time player come to site
|
||||||
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
|
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
|
||||||
@@ -2898,8 +2899,7 @@ void GetMercSiteBackOnline()
|
|||||||
if( IsSpeckComAvailable() )
|
if( IsSpeckComAvailable() )
|
||||||
{
|
{
|
||||||
//Add an email telling the user the site is back up
|
//Add an email telling the user the site is back up
|
||||||
AddEmail( MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1 , TYPE_EMAIL_EMAIL_EDT);
|
AddEmail(MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_NEWSITE);
|
||||||
|
|
||||||
//Set a flag indicating that the server just went up ( so speck can make a comment when the player next visits the site )
|
//Set a flag indicating that the server just went up ( so speck can make a comment when the player next visits the site )
|
||||||
LaptopSaveInfo.fFirstVisitSinceServerWentDown = TRUE;
|
LaptopSaveInfo.fFirstVisitSinceServerWentDown = TRUE;
|
||||||
}
|
}
|
||||||
@@ -3212,7 +3212,7 @@ void NewMercsAvailableAtMercSiteCallBack()
|
|||||||
if (!sentNewMercsEmail)
|
if (!sentNewMercsEmail)
|
||||||
{
|
{
|
||||||
sentNewMercsEmail = true;
|
sentNewMercsEmail = true;
|
||||||
AddEmail(NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
|
AddEmail(NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_NEWPERSONNEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//new mercs are available
|
//new mercs are available
|
||||||
|
|||||||
+546
-1365
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 );
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ set(ModularizedTacticalAISrc
|
|||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/LegacyAIPlanFactory.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/LegacyAIPlanFactory.cpp"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/LegacyCreaturePlan.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/LegacyCreaturePlan.cpp"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/LegacyZombiePlan.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/LegacyZombiePlan.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/BoxerPlan.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/CivilianPlan.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/RobotPlan.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/SoldierPlan.cpp"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/NullPlan.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/NullPlan.cpp"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/NullPlanFactory.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/NullPlanFactory.cpp"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/Plan.cpp"
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/Plan.cpp"
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Plan.h"
|
||||||
|
|
||||||
|
namespace AI
|
||||||
|
{
|
||||||
|
namespace tactical
|
||||||
|
{
|
||||||
|
/**@class LegacyAIPlan
|
||||||
|
* @brief Component/Concrete Product. Wrapper/Re-Write of DecideAction()
|
||||||
|
*
|
||||||
|
* Wrapper around boxer related AI uplifted from original DecideAction() routines
|
||||||
|
*/
|
||||||
|
class LegacyAIBoxerPlan: public Plan
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
public:
|
||||||
|
LegacyAIBoxerPlan(SOLDIERTYPE* npc);
|
||||||
|
virtual void execute(PlanInputData& environment);
|
||||||
|
virtual bool done() const {return false;}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Plan.h"
|
||||||
|
|
||||||
|
namespace AI
|
||||||
|
{
|
||||||
|
namespace tactical
|
||||||
|
{
|
||||||
|
/**@class LegacyAIPlan
|
||||||
|
* @brief Component/Concrete Product. Wrapper/Re-Write of DecideAction()
|
||||||
|
*
|
||||||
|
* Wrapper around civilian/noncombatant related AI uplifted from original DecideAction() routines
|
||||||
|
*/
|
||||||
|
class CivilianPlan : public Plan
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
public:
|
||||||
|
CivilianPlan(SOLDIERTYPE* npc);
|
||||||
|
virtual void execute(PlanInputData& environment);
|
||||||
|
virtual bool done() const { return false; }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Plan.h"
|
||||||
|
|
||||||
|
namespace AI
|
||||||
|
{
|
||||||
|
namespace tactical
|
||||||
|
{
|
||||||
|
/**@class LegacyAIPlan
|
||||||
|
* @brief Component/Concrete Product. Wrapper/Re-Write of DecideAction()
|
||||||
|
*
|
||||||
|
* Wrapper around robot related AI uplifted from original DecideAction() routines
|
||||||
|
*/
|
||||||
|
class RobotPlan : public Plan
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
public:
|
||||||
|
RobotPlan(SOLDIERTYPE* npc);
|
||||||
|
virtual void execute(PlanInputData& environment);
|
||||||
|
virtual bool done() const { return false; }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Plan.h"
|
||||||
|
|
||||||
|
namespace AI
|
||||||
|
{
|
||||||
|
namespace tactical
|
||||||
|
{
|
||||||
|
/**@class LegacyAIPlan
|
||||||
|
* @brief Component/Concrete Product. Wrapper/Re-Write of DecideAction()
|
||||||
|
*
|
||||||
|
* Wrapper around soldier related AI uplifted from original DecideAction() routines
|
||||||
|
*/
|
||||||
|
class SoldierPlan : public Plan
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
public:
|
||||||
|
SoldierPlan(SOLDIERTYPE* npc);
|
||||||
|
virtual void execute(PlanInputData& environment);
|
||||||
|
virtual bool done() const { return false; }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#include "../include/BoxerPlan.h"
|
||||||
|
#include "../../TacticalAI/ai.h"
|
||||||
|
|
||||||
|
namespace AI
|
||||||
|
{
|
||||||
|
namespace tactical
|
||||||
|
{
|
||||||
|
LegacyAIBoxerPlan::LegacyAIBoxerPlan(SOLDIERTYPE* npc)
|
||||||
|
: Plan(npc)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LegacyAIBoxerPlan::execute(PlanInputData& environment)
|
||||||
|
{
|
||||||
|
switch (get_npc()->aiData.bAlertStatus)
|
||||||
|
{
|
||||||
|
case STATUS_GREEN:
|
||||||
|
get_npc()->aiData.bAction = DecideActionGreenBoxer(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_YELLOW:
|
||||||
|
get_npc()->aiData.bAction = DecideActionGreenBoxer(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_RED:
|
||||||
|
get_npc()->aiData.bAction = DecideActionBlackBoxer(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_BLACK:
|
||||||
|
get_npc()->aiData.bAction = DecideActionBlackBoxer(get_npc());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace tactical
|
||||||
|
} // namespace AI
|
||||||
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
#include "../include/CivilianPlan.h"
|
||||||
|
#include "../../TacticalAI/ai.h"
|
||||||
|
#include "NPC.h"
|
||||||
|
#include "Soldier Profile.h"
|
||||||
|
|
||||||
|
namespace AI
|
||||||
|
{
|
||||||
|
namespace tactical
|
||||||
|
{
|
||||||
|
CivilianPlan::CivilianPlan(SOLDIERTYPE* npc)
|
||||||
|
: Plan(npc)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CivilianPlan::execute(PlanInputData& environment)
|
||||||
|
{
|
||||||
|
if ( !environment.turn_based() )
|
||||||
|
{
|
||||||
|
if ( (get_npc()->ubProfile != NO_PROFILE) && (gMercProfiles[get_npc()->ubProfile].ubMiscFlags3 & PROFILE_MISC_FLAG3_HANDLE_DONE_TRAVERSAL) )
|
||||||
|
{
|
||||||
|
TriggerNPCWithGivenApproach(get_npc()->ubProfile, APPROACH_DONE_TRAVERSAL, FALSE);
|
||||||
|
gMercProfiles[get_npc()->ubProfile].ubMiscFlags3 &= (~PROFILE_MISC_FLAG3_HANDLE_DONE_TRAVERSAL);
|
||||||
|
get_npc()->ubQuoteActionID = 0;
|
||||||
|
// wait a tiny bit
|
||||||
|
get_npc()->aiData.usActionData = 100;
|
||||||
|
get_npc()->aiData.bAction = AI_ACTION_WAIT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (get_npc()->aiData.bAlertStatus)
|
||||||
|
{
|
||||||
|
case STATUS_GREEN:
|
||||||
|
get_npc()->aiData.bAction = DecideActionGreenCivilian(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_YELLOW:
|
||||||
|
get_npc()->aiData.bAction = DecideActionYellowCivilian(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_RED:
|
||||||
|
get_npc()->aiData.bAction = DecideActionRedCivilian(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_BLACK:
|
||||||
|
get_npc()->aiData.bAction = DecideActionBlackCivilian(get_npc());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace tactical
|
||||||
|
} // namespace AI
|
||||||
|
|
||||||
@@ -7,6 +7,10 @@
|
|||||||
#include "../include/LegacyCreaturePlan.h"
|
#include "../include/LegacyCreaturePlan.h"
|
||||||
#include "../include/LegacyZombiePlan.h"
|
#include "../include/LegacyZombiePlan.h"
|
||||||
#include "../include/LegacyArmedVehiclePlan.h"
|
#include "../include/LegacyArmedVehiclePlan.h"
|
||||||
|
#include "../include/BoxerPlan.h"
|
||||||
|
#include "../include/CivilianPlan.h"
|
||||||
|
#include "../include/RobotPlan.h"
|
||||||
|
#include "../include/SoldierPlan.h"
|
||||||
#include "../include/CrowPlan.h"
|
#include "../include/CrowPlan.h"
|
||||||
#include "../include/PlanList.h"
|
#include "../include/PlanList.h"
|
||||||
|
|
||||||
@@ -14,8 +18,7 @@
|
|||||||
#include "../../Tactical/Soldier Control.h" // For SOLDIERTYPE definition
|
#include "../../Tactical/Soldier Control.h" // For SOLDIERTYPE definition
|
||||||
#include "../../Tactical/Animation Data.h" // For the definition of, wait for it... BLOODCAT!
|
#include "../../Tactical/Animation Data.h" // For the definition of, wait for it... BLOODCAT!
|
||||||
#include "Soldier macros.h"
|
#include "Soldier macros.h"
|
||||||
|
#include "ai.h"
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace AI
|
namespace AI
|
||||||
@@ -43,6 +46,11 @@ namespace AI
|
|||||||
if(npc->IsZombie())
|
if(npc->IsZombie())
|
||||||
return new LegacyZombiePlan(npc);
|
return new LegacyZombiePlan(npc);
|
||||||
|
|
||||||
|
if (BOXER(npc)) { return new LegacyAIBoxerPlan(npc); }
|
||||||
|
if (IS_CIV_BODY_TYPE(npc)) { return new CivilianPlan(npc); }
|
||||||
|
if (ENEMYROBOT(npc)) { return new RobotPlan(npc); }
|
||||||
|
if (SoldierAI(npc)) { return new SoldierPlan(npc); }
|
||||||
|
|
||||||
return new LegacyAIPlan(npc); // no special plan for other cases yet, return default legacy AI wrapper
|
return new LegacyAIPlan(npc); // no special plan for other cases yet, return default legacy AI wrapper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#include "../include/RobotPlan.h"
|
||||||
|
#include "../../TacticalAI/ai.h"
|
||||||
|
|
||||||
|
namespace AI
|
||||||
|
{
|
||||||
|
namespace tactical
|
||||||
|
{
|
||||||
|
RobotPlan::RobotPlan(SOLDIERTYPE* npc)
|
||||||
|
: Plan(npc)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RobotPlan::execute(PlanInputData& environment)
|
||||||
|
{
|
||||||
|
switch (get_npc()->aiData.bAlertStatus)
|
||||||
|
{
|
||||||
|
case STATUS_GREEN:
|
||||||
|
get_npc()->aiData.bAction = DecideActionGreenRobot(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_YELLOW:
|
||||||
|
get_npc()->aiData.bAction = DecideActionYellowRobot(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_RED:
|
||||||
|
get_npc()->aiData.bAction = DecideActionRedRobot(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_BLACK:
|
||||||
|
get_npc()->aiData.bAction = DecideActionBlackRobot(get_npc());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace tactical
|
||||||
|
} // namespace AI
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
#include "../include/SoldierPlan.h"
|
||||||
|
#include "../../TacticalAI/ai.h"
|
||||||
|
#include "../../TacticalAI/AIInternals.h" // ACTING_ON_SCHEDULE
|
||||||
|
#include "../../TacticalAI/NPC.h" // NPCReachedDestination
|
||||||
|
#include "../../Tactical/Dialogue Control.h" // DialogueQueueIsEmpty
|
||||||
|
#include "../../Utils/Font Control.h" // ScreenMsg about deadlock
|
||||||
|
#include "../../i18n/include/Text.h" // Sniper warning
|
||||||
|
#include "../../Utils/message.h" // ditto
|
||||||
|
|
||||||
|
namespace AI
|
||||||
|
{
|
||||||
|
namespace tactical
|
||||||
|
{
|
||||||
|
SoldierPlan::SoldierPlan(SOLDIERTYPE* npc)
|
||||||
|
: Plan(npc)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SoldierPlan::execute(PlanInputData& environment)
|
||||||
|
{
|
||||||
|
if (!environment.turn_based())
|
||||||
|
{
|
||||||
|
if ((get_npc()->ubProfile != NO_PROFILE) && (gMercProfiles[get_npc()->ubProfile].ubMiscFlags3 & PROFILE_MISC_FLAG3_HANDLE_DONE_TRAVERSAL))
|
||||||
|
{
|
||||||
|
TriggerNPCWithGivenApproach(get_npc()->ubProfile, APPROACH_DONE_TRAVERSAL, FALSE);
|
||||||
|
gMercProfiles[get_npc()->ubProfile].ubMiscFlags3 &= (~PROFILE_MISC_FLAG3_HANDLE_DONE_TRAVERSAL);
|
||||||
|
get_npc()->ubQuoteActionID = 0;
|
||||||
|
// wait a tiny bit
|
||||||
|
get_npc()->aiData.usActionData = 100;
|
||||||
|
get_npc()->aiData.bAction = AI_ACTION_WAIT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (get_npc()->bTeam == gbPlayerNum)
|
||||||
|
{
|
||||||
|
if (environment.get_tactical_status().fAutoBandageMode)
|
||||||
|
{
|
||||||
|
get_npc()->aiData.bAction = DecideAutoBandage(get_npc());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (get_npc()->bTeam != MILITIA_TEAM)
|
||||||
|
{
|
||||||
|
if (!sniperwarning && get_npc()->aiData.bOrders == SNIPER)
|
||||||
|
{
|
||||||
|
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_WATHCHOUTFORSNIPERS]);
|
||||||
|
sniperwarning = TRUE;
|
||||||
|
|
||||||
|
// Flugente: additional dialogue
|
||||||
|
AdditionalTacticalCharacterDialogue_AllInCurrentSector(NO_PROFILE, ADE_SNIPERWARNING);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!biggunwarning && FindRocketLauncherOrCannon(get_npc()) != NO_SLOT)
|
||||||
|
{
|
||||||
|
biggunwarning = TRUE;
|
||||||
|
//TODO: don't say this again after reloading a savegame
|
||||||
|
SayQuoteFromAnyBodyInSector(QUOTE_WEARY_SLASH_SUSPUCIOUS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
get_npc()->aiData.fAIFlags &= (~AI_CAUTIOUS); // turn off cautious flag
|
||||||
|
// if status override is set, bypass RED/YELLOW and go directly to GREEN!
|
||||||
|
if ((get_npc()->aiData.bBypassToGreen) && (get_npc()->aiData.bAlertStatus < STATUS_BLACK))
|
||||||
|
{
|
||||||
|
get_npc()->aiData.bAction = DecideActionGreenSoldier(get_npc());
|
||||||
|
if (!gfTurnBasedAI)
|
||||||
|
{
|
||||||
|
// reset bypass now
|
||||||
|
get_npc()->aiData.bBypassToGreen = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (get_npc()->aiData.bAlertStatus)
|
||||||
|
{
|
||||||
|
case STATUS_GREEN:
|
||||||
|
get_npc()->aiData.bAction = DecideActionGreenSoldier(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_YELLOW:
|
||||||
|
get_npc()->aiData.bAction = DecideActionYellowSoldier(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_RED:
|
||||||
|
get_npc()->aiData.bAction = DecideActionRedSoldier(get_npc());
|
||||||
|
break;
|
||||||
|
case STATUS_BLACK:
|
||||||
|
//if ( gGameSettings.fOptions[TOPTION_USE_LEGACY_TACTICALAI] ) // Commented out for now since new AI is WIP
|
||||||
|
{
|
||||||
|
get_npc()->aiData.bAction = DecideActionBlackSoldier(get_npc());
|
||||||
|
}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// get_npc()->aiData.bAction = DecideActionBlackSoldierUtilityAI(get_npc());
|
||||||
|
//}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DEBUGAIMSG("Deciding for guynum " << (int)get_npc()->ubID << " at gridno " << get_npc()->sGridNo << ", APs " << get_npc()->bActionPoints <<
|
||||||
|
", decided action: " << (int)get_npc()->aiData.bAction << ", data " << (int)get_npc()->aiData.usActionData);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace tactical
|
||||||
|
} // namespace AI
|
||||||
|
|
||||||
+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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,33 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include "Event Pump.h"
|
||||||
//time for a new header :)
|
//time for a new header :)
|
||||||
extern int readyteamreg[10];
|
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)
|
||||||
|
|||||||
+8
-11
@@ -8,7 +8,6 @@
|
|||||||
#include "vsurface.h"
|
#include "vsurface.h"
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "Editor Taskbar Utils.h"
|
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
@@ -16,7 +15,6 @@
|
|||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "FileMan.h"
|
#include "FileMan.h"
|
||||||
#include "Map Information.h"
|
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
#include "Campaign Types.h"
|
#include "Campaign Types.h"
|
||||||
@@ -157,7 +155,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 +534,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 +646,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 +692,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 +719,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 +1829,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;
|
||||||
|
|
||||||
|
|||||||
+4
-24
@@ -6,35 +6,18 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "ASD.h"
|
#include "ASD.h"
|
||||||
#include "strategic.h"
|
#include "strategic.h"
|
||||||
#include "WCheck.h"
|
|
||||||
#include "Utilities.h"
|
|
||||||
#include "WordWrap.h"
|
|
||||||
#include "Cursors.h"
|
|
||||||
#include "line.h"
|
|
||||||
#include "Insurance Text.h"
|
|
||||||
#include "Encrypted File.h"
|
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Multi Language Graphic Utils.h"
|
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
#include "Soldier Add.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "Map Screen Interface.h"
|
#include <Font Control.h>
|
||||||
#include "finances.h"
|
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
#include "SaveLoadGame.h"
|
#include "SaveLoadGame.h"
|
||||||
#include "GameVersion.h"
|
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "Game Event Hook.h"
|
#include "Game Event Hook.h"
|
||||||
#include "Militia Control.h"
|
|
||||||
#include "Town Militia.h"
|
#include "Town Militia.h"
|
||||||
#include "Strategic Town Loyalty.h"
|
|
||||||
#include "Map Information.h"
|
|
||||||
|
|
||||||
#include "Campaign.h"
|
#include "Campaign.h"
|
||||||
#include "random.h"
|
|
||||||
#include "Explosion Control.h"
|
|
||||||
#include "Strategic AI.h"
|
#include "Strategic AI.h"
|
||||||
#include "Strategic Mines.h"
|
#include "Strategic Mines.h"
|
||||||
#include "Reinforcement.h"
|
#include "Reinforcement.h"
|
||||||
@@ -42,9 +25,6 @@
|
|||||||
#include "Queen Command.h"
|
#include "Queen Command.h"
|
||||||
#include "Map Screen Helicopter.h"
|
#include "Map Screen Helicopter.h"
|
||||||
#include "Points.h"
|
#include "Points.h"
|
||||||
#include "worldman.h"
|
|
||||||
#include "Map Information.h"
|
|
||||||
#include "opplist.h"
|
|
||||||
#include "Dialogue Control.h"
|
#include "Dialogue Control.h"
|
||||||
#include "Sound Control.h"
|
#include "Sound Control.h"
|
||||||
#include "renderworld.h"
|
#include "renderworld.h"
|
||||||
@@ -1091,7 +1071,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 +1122,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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+506
-456
File diff suppressed because it is too large
Load Diff
+21
-1
@@ -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);
|
||||||
|
|
||||||
|
|||||||
+139
-140
@@ -1,75 +1,68 @@
|
|||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "Auto Resolve.h"
|
#include "Auto Resolve.h"
|
||||||
#include "Strategic Movement.h"
|
#include "Strategic Movement.h"
|
||||||
#include "Queen Command.h"
|
#include "Queen Command.h"
|
||||||
#include "Music Control.h"
|
#include "Music Control.h"
|
||||||
#include "PreBattle Interface.h"
|
#include "PreBattle Interface.h"
|
||||||
#include "Player Command.h"
|
#include "Player Command.h"
|
||||||
#include "mousesystem.h"
|
#include "mousesystem.h"
|
||||||
#include "Button System.h"
|
#include "Button System.h"
|
||||||
#include "gameloop.h"
|
#include "gameloop.h"
|
||||||
#include "screenids.h"
|
#include "screenids.h"
|
||||||
#include "mapscreen.h"
|
#include "mapscreen.h"
|
||||||
#include "vobject.h"
|
#include "vobject.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "gamescreen.h"
|
#include "gamescreen.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "vobject_blitters.h"
|
#include "vobject_blitters.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "Soldier Create.h"
|
#include "Soldier Create.h"
|
||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "Interface.h"
|
#include "Items.h"
|
||||||
#include "Items.h"
|
#include "Weapons.h"
|
||||||
#include "Weapons.h"
|
#include "Sound Control.h"
|
||||||
#include "Sound Control.h"
|
#include "Game Clock.h"
|
||||||
#include "Game Clock.h"
|
#include "Soldier Profile.h"
|
||||||
#include "Soldier Profile.h"
|
#include "Campaign.h"
|
||||||
#include "Campaign.h"
|
#include "Tactical Save.h"
|
||||||
#include "Tactical Save.h"
|
#include "Strategic Status.h"
|
||||||
#include "Strategic Status.h"
|
#include "Text.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "WordWrap.h"
|
||||||
#include "Text.h"
|
#include "Squads.h"
|
||||||
#include "WordWrap.h"
|
#include "random.h"
|
||||||
#include "Squads.h"
|
#include "line.h"
|
||||||
#include "random.h"
|
#include "english.h"
|
||||||
#include "line.h"
|
#include "Strategic Merc Handler.h"
|
||||||
#include "english.h"
|
#include "strategic.h"
|
||||||
#include "Strategic Pathing.h"
|
#include "message.h"
|
||||||
#include "Strategic Merc Handler.h"
|
#include "Town Militia.h"
|
||||||
#include "strategic.h"
|
#include "Animation Data.h"
|
||||||
#include "message.h"
|
#include "Creature Spreading.h"
|
||||||
#include "Town Militia.h"
|
#include "Strategic AI.h"
|
||||||
#include "Animation Data.h"
|
#include "Morale.h"
|
||||||
#include "Creature Spreading.h"
|
#include "Strategic Town Loyalty.h"
|
||||||
#include "Strategic AI.h"
|
#include "GameSettings.h"
|
||||||
#include "SkillCheck.h"
|
#include "Soldier macros.h"
|
||||||
#include "rt time defines.h"
|
#include "strategicmap.h"
|
||||||
#include "Morale.h"
|
#include "Quests.h"
|
||||||
#include "Strategic Town Loyalty.h"
|
#include "Meanwhile.h"
|
||||||
#include "GameSettings.h"
|
#include "Inventory Choosing.h"
|
||||||
#include "Soldier macros.h"
|
#include "Game Event Hook.h"
|
||||||
#include "strategicmap.h"
|
#include "Assignments.h"
|
||||||
#include "Quests.h"
|
#include "Cheats.h"
|
||||||
#include "Meanwhile.h"
|
#include "Map Information.h"
|
||||||
#include "Inventory Choosing.h"
|
#include "MilitiaSquads.h"
|
||||||
#include "Game Event Hook.h"
|
#include "interface Dialogue.h"
|
||||||
#include "Assignments.h"
|
#include "AIInternals.h" // added by SANDRO
|
||||||
#include "Cheats.h"
|
#include "Bullets.h" // HEADROCK HAM 5, for use with Bullet Impact.
|
||||||
#include "Map Information.h"
|
#include "CampaignStats.h" // added by Flugente
|
||||||
#include "MilitiaSquads.h"
|
#include "DynamicDialogue.h" // added by Flugente
|
||||||
// #include "Strategic AI.h"
|
#include "MilitiaIndividual.h" // added by Flugente
|
||||||
#include "interface Dialogue.h"
|
#include "Rebel Command.h"
|
||||||
#include "AIInternals.h" // added by SANDRO
|
|
||||||
#include "Bullets.h" // HEADROCK HAM 5, for use with Bullet Impact.
|
|
||||||
#include "CampaignStats.h" // added by Flugente
|
|
||||||
#include "DynamicDialogue.h" // added by Flugente
|
|
||||||
#include "MilitiaIndividual.h" // added by Flugente
|
|
||||||
#include "Rebel Command.h"
|
|
||||||
|
|
||||||
#include "Reinforcement.h"
|
#include "Reinforcement.h"
|
||||||
|
|
||||||
//#define INVULNERABILITY
|
//#define INVULNERABILITY
|
||||||
@@ -163,13 +156,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;
|
||||||
@@ -337,7 +330,7 @@ SOLDIERCELL *gpCivs = NULL;
|
|||||||
SOLDIERCELL *gpEnemies = NULL;
|
SOLDIERCELL *gpEnemies = NULL;
|
||||||
|
|
||||||
//Simple wrappers for autoresolve sounds that are played.
|
//Simple wrappers for autoresolve sounds that are played.
|
||||||
void PlayAutoResolveSample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
|
static void PlayAutoResolveSample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
|
||||||
{
|
{
|
||||||
if( gpAR->fSound )
|
if( gpAR->fSound )
|
||||||
{
|
{
|
||||||
@@ -345,7 +338,7 @@ void PlayAutoResolveSample( UINT32 usNum, UINT32 usRate, UINT32 ubVolume, UINT32
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayAutoResolveSampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
|
static void PlayAutoResolveSampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVolume, UINT32 ubLoops, UINT32 uiPan )
|
||||||
{
|
{
|
||||||
if( gpAR->fSound )
|
if( gpAR->fSound )
|
||||||
{
|
{
|
||||||
@@ -356,7 +349,7 @@ void PlayAutoResolveSampleFromFile( STR8 szFileName, UINT32 usRate, UINT32 ubVol
|
|||||||
|
|
||||||
extern void ClearPreviousAIGroupAssignment( GROUP *pGroup );
|
extern void ClearPreviousAIGroupAssignment( GROUP *pGroup );
|
||||||
|
|
||||||
void EliminateAllMercs()
|
static void EliminateAllMercs()
|
||||||
{
|
{
|
||||||
SOLDIERCELL *pAttacker = NULL;
|
SOLDIERCELL *pAttacker = NULL;
|
||||||
INT32 i, iNum = 0;
|
INT32 i, iNum = 0;
|
||||||
@@ -387,7 +380,7 @@ void EliminateAllMercs()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EliminateAllFriendlies()
|
static void EliminateAllFriendlies()
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
if( gpAR )
|
if( gpAR )
|
||||||
@@ -410,10 +403,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 +453,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 )
|
||||||
{
|
{
|
||||||
@@ -504,7 +496,7 @@ void EliminateAllEnemies( UINT8 ubSectorX, UINT8 ubSectorY )
|
|||||||
#define ORIG_RIGHT 92
|
#define ORIG_RIGHT 92
|
||||||
#define ORIG_BOTTOM 84
|
#define ORIG_BOTTOM 84
|
||||||
|
|
||||||
void DoTransitionFromPreBattleInterfaceToAutoResolve()
|
static void DoTransitionFromPreBattleInterfaceToAutoResolve()
|
||||||
{
|
{
|
||||||
SGPRect SrcRect, DstRect;
|
SGPRect SrcRect, DstRect;
|
||||||
UINT32 uiStartTime, uiCurrTime;
|
UINT32 uiStartTime, uiCurrTime;
|
||||||
@@ -735,7 +727,7 @@ UINT32 AutoResolveScreenHandle()
|
|||||||
return AUTORESOLVE_SCREEN;
|
return AUTORESOLVE_SCREEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshMerc( SOLDIERTYPE *pSoldier )
|
static void RefreshMerc( SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
pSoldier->stats.bLife = pSoldier->stats.bLifeMax;
|
pSoldier->stats.bLife = pSoldier->stats.bLifeMax;
|
||||||
pSoldier->bBleeding = 0;
|
pSoldier->bBleeding = 0;
|
||||||
@@ -751,13 +743,13 @@ void RefreshMerc( SOLDIERTYPE *pSoldier )
|
|||||||
|
|
||||||
//Now assign the pSoldier->ubGroupIDs for the enemies, so we know where to remove them. Start with
|
//Now assign the pSoldier->ubGroupIDs for the enemies, so we know where to remove them. Start with
|
||||||
//stationary groups first.
|
//stationary groups first.
|
||||||
void AssociateEnemiesWithStrategicGroups()
|
static 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;
|
||||||
@@ -1194,7 +1186,7 @@ void CalculateSoldierCells( BOOLEAN fReset )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INT32 DetermineCellID( SOLDIERCELL *pCell )
|
static INT32 DetermineCellID( SOLDIERCELL *pCell )
|
||||||
{
|
{
|
||||||
INT32 iIndex;
|
INT32 iIndex;
|
||||||
|
|
||||||
@@ -1213,7 +1205,7 @@ INT32 DetermineCellID( SOLDIERCELL *pCell )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN IsItAllowedToRender( SOLDIERCELL *pCell )
|
static BOOLEAN IsItAllowedToRender( SOLDIERCELL *pCell )
|
||||||
{
|
{
|
||||||
INT32 iID = DetermineCellID( pCell );
|
INT32 iID = DetermineCellID( pCell );
|
||||||
|
|
||||||
@@ -1356,7 +1348,7 @@ void RenderSoldierCellBars( SOLDIERCELL *pCell )
|
|||||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+46, iStartY, pCell->xp+47, pCell->yp+29, Get16BPPColor( FROMRGB( 8, 107, 8 ) ) );
|
ColorFillVideoSurfaceArea( FRAME_BUFFER, pCell->xp+46, iStartY, pCell->xp+47, pCell->yp+29, Get16BPPColor( FROMRGB( 8, 107, 8 ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildInterfaceBuffer()
|
static void BuildInterfaceBuffer()
|
||||||
{
|
{
|
||||||
VSURFACE_DESC vs_desc;
|
VSURFACE_DESC vs_desc;
|
||||||
UINT16 usUselessWidth, usUselessHeight;
|
UINT16 usUselessWidth, usUselessHeight;
|
||||||
@@ -1438,7 +1430,7 @@ void BuildInterfaceBuffer()
|
|||||||
SetClippingRect( &ClipRect );
|
SetClippingRect( &ClipRect );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExpandWindow()
|
static void ExpandWindow()
|
||||||
{
|
{
|
||||||
SGPRect OldRect;
|
SGPRect OldRect;
|
||||||
UINT32 uiDestPitchBYTES;
|
UINT32 uiDestPitchBYTES;
|
||||||
@@ -1533,7 +1525,7 @@ void ExpandWindow()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJECTTYPE* FindMedicalKit()
|
static OBJECTTYPE* FindMedicalKit()
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
INT32 iSlot;
|
INT32 iSlot;
|
||||||
@@ -1548,7 +1540,7 @@ OBJECTTYPE* FindMedicalKit()
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 AutoBandageMercs()
|
static UINT32 AutoBandageMercs()
|
||||||
{
|
{
|
||||||
INT32 i, iBest;
|
INT32 i, iBest;
|
||||||
UINT32 uiPointsUsed, uiCurrPointsUsed, uiMaxPointsUsed, uiParallelPointsUsed;
|
UINT32 uiPointsUsed, uiCurrPointsUsed, uiMaxPointsUsed, uiParallelPointsUsed;
|
||||||
@@ -1839,7 +1831,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 +1845,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 +2045,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 +2074,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 +2197,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 +2834,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 +3008,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 +3062,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 +3082,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 +3091,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;
|
||||||
@@ -3728,14 +3723,14 @@ void RenderSoldierCellHealth( SOLDIERCELL *pCell )
|
|||||||
mprintf( xp, yp, pStr );
|
mprintf( xp, yp, pStr );
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 GetUnusedMercProfileID()
|
static UINT8 GetUnusedMercProfileID()
|
||||||
{
|
{
|
||||||
UINT8 ubRandom=0;
|
UINT8 ubRandom=0;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
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 +3748,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;
|
||||||
@@ -3823,7 +3818,7 @@ void DetermineTeamLeader( BOOLEAN fFriendlyTeam )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetNextAttackCounter( SOLDIERCELL *pCell )
|
static void ResetNextAttackCounter( SOLDIERCELL *pCell )
|
||||||
{
|
{
|
||||||
pCell->usNextAttack = min( 1000 - pCell->usAttack, 800 );
|
pCell->usNextAttack = min( 1000 - pCell->usAttack, 800 );
|
||||||
pCell->usNextAttack = (UINT16)(1000 + pCell->usNextAttack * 5 + PreRandom( 2000 - pCell->usAttack ) );
|
pCell->usNextAttack = (UINT16)(1000 + pCell->usNextAttack * 5 + PreRandom( 2000 - pCell->usAttack ) );
|
||||||
@@ -3833,7 +3828,7 @@ void ResetNextAttackCounter( SOLDIERCELL *pCell )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOAT CalcClassBonusOrPenalty( SOLDIERTYPE *pSoldier )
|
static FLOAT CalcClassBonusOrPenalty( SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
switch( pSoldier->ubSoldierClass )
|
switch( pSoldier->ubSoldierClass )
|
||||||
{
|
{
|
||||||
@@ -4113,7 +4108,7 @@ void DrawDebugText( SOLDIERCELL *pCell )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SOLDIERCELL* ChooseTarget( SOLDIERCELL *pAttacker )
|
static SOLDIERCELL* ChooseTarget( SOLDIERCELL *pAttacker )
|
||||||
{
|
{
|
||||||
INT32 iAvailableTargets;
|
INT32 iAvailableTargets;
|
||||||
INT32 index;
|
INT32 index;
|
||||||
@@ -4183,7 +4178,7 @@ SOLDIERCELL* ChooseTarget( SOLDIERCELL *pAttacker )
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN FireAShot( SOLDIERCELL *pAttacker )
|
static BOOLEAN FireAShot( SOLDIERCELL *pAttacker )
|
||||||
{
|
{
|
||||||
OBJECTTYPE *pItem;
|
OBJECTTYPE *pItem;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
@@ -4237,7 +4232,7 @@ BOOLEAN FireAShot( SOLDIERCELL *pAttacker )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN FireTankCannon( SOLDIERCELL *pAttacker )
|
static BOOLEAN FireTankCannon( SOLDIERCELL *pAttacker )
|
||||||
{
|
{
|
||||||
OBJECTTYPE *pItem;
|
OBJECTTYPE *pItem;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
@@ -4279,7 +4274,7 @@ BOOLEAN FireTankCannon( SOLDIERCELL *pAttacker )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN FireAntiTankWeapon( SOLDIERCELL *pAttacker )
|
static BOOLEAN FireAntiTankWeapon( SOLDIERCELL *pAttacker )
|
||||||
{
|
{
|
||||||
OBJECTTYPE *pItem;
|
OBJECTTYPE *pItem;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
@@ -4334,7 +4329,7 @@ BOOLEAN FireAntiTankWeapon( SOLDIERCELL *pAttacker )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN AttackerHasKnife( SOLDIERCELL *pAttacker )
|
static BOOLEAN AttackerHasKnife( SOLDIERCELL *pAttacker )
|
||||||
{
|
{
|
||||||
UINT8 invsize = pAttacker->pSoldier->inv.size();
|
UINT8 invsize = pAttacker->pSoldier->inv.size();
|
||||||
for( UINT8 i = 0; i < invsize; ++i )
|
for( UINT8 i = 0; i < invsize; ++i )
|
||||||
@@ -4349,7 +4344,7 @@ BOOLEAN AttackerHasKnife( SOLDIERCELL *pAttacker )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN TargetHasLoadedGun( SOLDIERTYPE *pSoldier )
|
static BOOLEAN TargetHasLoadedGun( SOLDIERTYPE *pSoldier )
|
||||||
{
|
{
|
||||||
OBJECTTYPE *pItem;
|
OBJECTTYPE *pItem;
|
||||||
UINT8 invsize = pSoldier->inv.size();
|
UINT8 invsize = pSoldier->inv.size();
|
||||||
@@ -4371,7 +4366,7 @@ BOOLEAN TargetHasLoadedGun( SOLDIERTYPE *pSoldier )
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
static void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
||||||
{
|
{
|
||||||
INT16 sAttack;
|
INT16 sAttack;
|
||||||
INT16 sDefence;
|
INT16 sDefence;
|
||||||
@@ -4991,7 +4986,7 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetHitCallback( SOLDIERCELL *pTarget, INT32 index )
|
static void TargetHitCallback( SOLDIERCELL *pTarget, INT32 index )
|
||||||
{
|
{
|
||||||
INT32 iNewLife;
|
INT32 iNewLife;
|
||||||
SOLDIERCELL *pAttacker;
|
SOLDIERCELL *pAttacker;
|
||||||
@@ -5305,7 +5300,7 @@ void TargetHitCallback( SOLDIERCELL *pTarget, INT32 index )
|
|||||||
pTarget->uiFlags |= CELL_HITBYATTACKER | CELL_DIRTY;
|
pTarget->uiFlags |= CELL_HITBYATTACKER | CELL_DIRTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Delay( UINT32 uiMilliseconds )
|
static void Delay( UINT32 uiMilliseconds )
|
||||||
{
|
{
|
||||||
INT32 iTime;
|
INT32 iTime;
|
||||||
iTime = GetJA2Clock();
|
iTime = GetJA2Clock();
|
||||||
@@ -5961,12 +5956,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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
#include "Campaign Init.h"
|
#include "Campaign Init.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "Campaign Types.h"
|
#include "Campaign Types.h"
|
||||||
#include "Queen Command.h"
|
|
||||||
#include "Overhead.h"
|
|
||||||
#include "Strategic Movement.h"
|
#include "Strategic Movement.h"
|
||||||
#include "Strategic Status.h"
|
#include "Strategic Status.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
@@ -15,7 +13,6 @@
|
|||||||
#include "Tactical Save.h"
|
#include "Tactical Save.h"
|
||||||
|
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include <vfs/Core/vfs.h>
|
|
||||||
#include "XMLWriter.h"
|
#include "XMLWriter.h"
|
||||||
|
|
||||||
#include "UndergroundInit.h"
|
#include "UndergroundInit.h"
|
||||||
@@ -309,7 +306,7 @@ void InitKnowFacilitiesFlags( )
|
|||||||
|
|
||||||
|
|
||||||
//Mobile groups are handled separately from sectors, because they are on the move.
|
//Mobile groups are handled separately from sectors, because they are on the move.
|
||||||
void GeneratePatrolGroups()
|
static void GeneratePatrolGroups()
|
||||||
{
|
{
|
||||||
GROUP *pGroup;
|
GROUP *pGroup;
|
||||||
UINT8 ubNumTroops;
|
UINT8 ubNumTroops;
|
||||||
@@ -527,7 +524,7 @@ void BuildUndergroundSectorInfoList()
|
|||||||
// Lesh: this function creates randomized world
|
// Lesh: this function creates randomized world
|
||||||
// every sector can be randomized between common and alternative, chances 50/50
|
// every sector can be randomized between common and alternative, chances 50/50
|
||||||
// randomization of individual sectors can be switched off via array RandomSector[]
|
// randomization of individual sectors can be switched off via array RandomSector[]
|
||||||
void InitWorld()
|
static void InitWorld()
|
||||||
{
|
{
|
||||||
INT16 sSectorCounter;
|
INT16 sSectorCounter;
|
||||||
|
|
||||||
|
|||||||
+26
-29
@@ -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!
|
||||||
|
|||||||
@@ -24,16 +24,11 @@
|
|||||||
#include "Animation Data.h"
|
#include "Animation Data.h"
|
||||||
#include "opplist.h"
|
#include "opplist.h"
|
||||||
#include "Meanwhile.h"
|
#include "Meanwhile.h"
|
||||||
#include "Strategic AI.h"
|
|
||||||
#include "MessageBoxScreen.h"
|
|
||||||
#include "Map Information.h"
|
#include "Map Information.h"
|
||||||
#include "Queen Command.h"
|
#include "Queen Command.h"
|
||||||
#include "ai.h" // added by Flugente
|
#include "ai.h" // added by Flugente
|
||||||
#include "Isometric Utils.h" // added by Flugente
|
|
||||||
#include "Soldier Create.h" // added by Flugente
|
#include "Soldier Create.h" // added by Flugente
|
||||||
#include "Player Command.h" // added by Flugente
|
|
||||||
|
|
||||||
#include "Strategic Mines.h"
|
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
|
|
||||||
#include "GameInitOptionsScreen.h"
|
#include "GameInitOptionsScreen.h"
|
||||||
@@ -139,11 +134,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;
|
||||||
|
|
||||||
@@ -160,7 +155,7 @@ extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
|||||||
//extern MINE_STATUS_TYPE gMineStatus[ MAX_NUMBER_OF_MINES ];
|
//extern MINE_STATUS_TYPE gMineStatus[ MAX_NUMBER_OF_MINES ];
|
||||||
|
|
||||||
|
|
||||||
CREATURE_DIRECTIVE* NewDirective( UINT8 ubSectorID, UINT8 ubSectorZ, UINT8 ubCreatureHabitat )
|
static CREATURE_DIRECTIVE* NewDirective( UINT8 ubSectorID, UINT8 ubSectorZ, UINT8 ubCreatureHabitat )
|
||||||
{
|
{
|
||||||
CREATURE_DIRECTIVE *curr;
|
CREATURE_DIRECTIVE *curr;
|
||||||
UINT8 ubSectorX, ubSectorY;
|
UINT8 ubSectorX, ubSectorY;
|
||||||
@@ -278,7 +273,7 @@ void InitLairGrumm()
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void InitLair(INT32 iChosenMine)
|
static void InitLair(INT32 iChosenMine)
|
||||||
{
|
{
|
||||||
CREATURE_DIRECTIVE *curr;
|
CREATURE_DIRECTIVE *curr;
|
||||||
giLairID = iChosenMine;
|
giLairID = iChosenMine;
|
||||||
@@ -517,7 +512,7 @@ void InitCreatureQuest()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddCreatureToNode( CREATURE_DIRECTIVE *node )
|
static void AddCreatureToNode( CREATURE_DIRECTIVE *node )
|
||||||
{
|
{
|
||||||
node->pLevel->ubNumCreatures++;
|
node->pLevel->ubNumCreatures++;
|
||||||
|
|
||||||
@@ -529,7 +524,7 @@ void AddCreatureToNode( CREATURE_DIRECTIVE *node )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN PlaceNewCreature( CREATURE_DIRECTIVE *node, INT32 iDistance )
|
static BOOLEAN PlaceNewCreature( CREATURE_DIRECTIVE *node, INT32 iDistance )
|
||||||
{
|
{
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"CreatureSpreading1");
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"CreatureSpreading1");
|
||||||
if( !node )
|
if( !node )
|
||||||
@@ -677,7 +672,7 @@ void DecayCreatures()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddCreaturesToBattle( UINT8 ubNumYoungMales, UINT8 ubNumYoungFemales, UINT8 ubNumAdultMales, UINT8 ubNumAdultFemales )
|
static void AddCreaturesToBattle( UINT8 ubNumYoungMales, UINT8 ubNumYoungFemales, UINT8 ubNumAdultMales, UINT8 ubNumAdultFemales )
|
||||||
{
|
{
|
||||||
INT32 iRandom;
|
INT32 iRandom;
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
@@ -764,7 +759,7 @@ void AddCreaturesToBattle( UINT8 ubNumYoungMales, UINT8 ubNumYoungFemales, UINT8
|
|||||||
AllTeamsLookForAll( FALSE );
|
AllTeamsLookForAll( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddCreaturesToBattle_Other( UINT8 ubNum )
|
static void AddCreaturesToBattle_Other( UINT8 ubNum )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
MAPEDGEPOINTINFO MapEdgepointInfo = {};
|
MAPEDGEPOINTINFO MapEdgepointInfo = {};
|
||||||
@@ -851,7 +846,7 @@ void AddCreaturesToBattle_Other( UINT8 ubNum )
|
|||||||
AllTeamsLookForAll( FALSE );
|
AllTeamsLookForAll( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChooseTownSectorToAttack( UINT8 ubSectorID, BOOLEAN fOverrideTest )
|
static void ChooseTownSectorToAttack( UINT8 ubSectorID, BOOLEAN fOverrideTest )
|
||||||
{
|
{
|
||||||
INT32 iRandom, i;
|
INT32 iRandom, i;
|
||||||
UINT8 ubSectorX, ubSectorY;
|
UINT8 ubSectorX, ubSectorY;
|
||||||
@@ -1482,7 +1477,7 @@ void ChooseCreatureQuestStartDay()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteDirectiveNode( CREATURE_DIRECTIVE **node )
|
static void DeleteDirectiveNode( CREATURE_DIRECTIVE **node )
|
||||||
{
|
{
|
||||||
if( (*node)->next )
|
if( (*node)->next )
|
||||||
DeleteDirectiveNode( &((*node)->next) );
|
DeleteDirectiveNode( &((*node)->next) );
|
||||||
@@ -1634,8 +1629,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 +1662,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 +1671,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 +1699,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 +1707,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 +1745,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 +2238,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 +2255,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 &&
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "Facilities.h"
|
#include "Facilities.h"
|
||||||
#include "Soldier Control.h"
|
#include "Soldier Control.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "Map Screen Interface.h"
|
||||||
#include "Overhead.h"
|
|
||||||
#include "Assignments.h"
|
#include "Assignments.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "LaptopSave.h"
|
#include "LaptopSave.h"
|
||||||
@@ -29,10 +28,7 @@
|
|||||||
#include "Interface.h"
|
#include "Interface.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "Morale.h"
|
#include "Morale.h"
|
||||||
#include "Points.h"
|
|
||||||
#include "Soldier Control.h"
|
|
||||||
#include "Isometric Utils.h"
|
#include "Isometric Utils.h"
|
||||||
#include "MilitiaSquads.h"
|
|
||||||
#include "Tactical Save.h"
|
#include "Tactical Save.h"
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
@@ -357,7 +353,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 +495,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 +558,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 +700,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 +1108,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,11 +1990,11 @@ 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 != NULL && !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
pSoldier->bSectorZ == 0 && pSoldier != NULL &&
|
pSoldier->bSectorZ == 0 &&
|
||||||
pSoldier->stats.bLife >= OKLIFE &&
|
pSoldier->stats.bLife >= OKLIFE &&
|
||||||
!(pSoldier->flags.fMercAsleep) )
|
!(pSoldier->flags.fMercAsleep) )
|
||||||
{
|
{
|
||||||
|
|||||||
+21
-25
@@ -1,28 +1,24 @@
|
|||||||
#include "sgp.h"
|
#include "sgp.h"
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
#include "Font.h"
|
#include "Font.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "Game Clock.h"
|
#include "message.h"
|
||||||
#include "message.h"
|
#include <mousesystem.h>
|
||||||
#include "Game Events.h"
|
#include "MercTextBox.h"
|
||||||
#include "Assignments.h"
|
#include "renderworld.h"
|
||||||
#include "MercTextBox.h"
|
#include "lighting.h"
|
||||||
#include "renderworld.h"
|
#include "Map Screen Interface.h"
|
||||||
#include "lighting.h"
|
#include "Event Pump.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "Text.h"
|
||||||
#include "PreBattle Interface.h"
|
#include "Interface Control.h"
|
||||||
#include "Event Pump.h"
|
#include "Map Screen Interface Map.h"
|
||||||
#include "Text.h"
|
#include "Map Screen Interface Bottom.h"
|
||||||
#include "Interface Control.h"
|
#include "gamescreen.h"
|
||||||
#include "Map Screen Interface Map.h"
|
#include "Map Information.h"
|
||||||
#include "Map Screen Interface Bottom.h"
|
#include "GameSettings.h"
|
||||||
#include "gamescreen.h"
|
|
||||||
#include "Map Information.h"
|
|
||||||
#include "GameSettings.h"
|
|
||||||
|
|
||||||
#include "LuaInitNPCs.h"
|
#include "LuaInitNPCs.h"
|
||||||
|
|
||||||
//#define DEBUG_GAME_CLOCK
|
//#define DEBUG_GAME_CLOCK
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include "environment.h"
|
#include "environment.h"
|
||||||
#include "Ambient Control.h"
|
#include "Ambient Control.h"
|
||||||
#include "Quests.h"
|
#include "Quests.h"
|
||||||
// #include "Sound Control.h"
|
|
||||||
#include "AimMembers.h"
|
#include "AimMembers.h"
|
||||||
#include "Strategic Event Handler.h"
|
#include "Strategic Event Handler.h"
|
||||||
#include "BobbyR.h"
|
#include "BobbyR.h"
|
||||||
@@ -17,14 +16,12 @@
|
|||||||
#include "Strategic Movement.h"
|
#include "Strategic Movement.h"
|
||||||
#include "Assignments.h"
|
#include "Assignments.h"
|
||||||
#include "Strategic Mines.h"
|
#include "Strategic Mines.h"
|
||||||
#include "Strategic Town Loyalty.h"
|
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "Map Screen Interface.h"
|
||||||
#include "Map Screen Helicopter.h"
|
#include "Map Screen Helicopter.h"
|
||||||
#include "Scheduling.h"
|
#include "Scheduling.h"
|
||||||
#include "Arms Dealer Init.h"
|
#include "Arms Dealer Init.h"
|
||||||
#include "strategic town reputation.h"
|
#include "strategic town reputation.h"
|
||||||
#include "Air Raid.h"
|
|
||||||
#include "Meanwhile.h"
|
#include "Meanwhile.h"
|
||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
@@ -32,7 +29,6 @@
|
|||||||
#include "Strategic AI.h"
|
#include "Strategic AI.h"
|
||||||
#include "Merc Contract.h"
|
#include "Merc Contract.h"
|
||||||
#include "Strategic Status.h"
|
#include "Strategic Status.h"
|
||||||
#include "INIReader.h"
|
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
@@ -50,7 +46,6 @@
|
|||||||
#include "Rebel Command.h"
|
#include "Rebel Command.h"
|
||||||
#include "interface Dialogue.h"
|
#include "interface Dialogue.h"
|
||||||
|
|
||||||
#include "connect.h"
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
#include "Explosion Control.h"
|
#include "Explosion Control.h"
|
||||||
@@ -85,7 +80,7 @@ void CrippledVersionEndGameCheck();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN DelayEventIfBattleInProgress( STRATEGICEVENT *pEvent )
|
static BOOLEAN DelayEventIfBattleInProgress( STRATEGICEVENT *pEvent )
|
||||||
{
|
{
|
||||||
STRATEGICEVENT *pNewEvent;
|
STRATEGICEVENT *pNewEvent;
|
||||||
if( gTacticalStatus.fEnemyInSector )
|
if( gTacticalStatus.fEnemyInSector )
|
||||||
@@ -215,7 +210,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
//No JA25 UB
|
//No JA25 UB
|
||||||
#else
|
#else
|
||||||
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin( ), -1, -1 ,TYPE_EMAIL_EMAIL_EDT );
|
AddEmail(MERC_INTRO, MERC_INTRO_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_SPECK_INTRO);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -225,7 +220,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 +228,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 +246,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 +390,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 +427,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:
|
||||||
@@ -489,7 +487,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
// No PCM in UB
|
// No PCM in UB
|
||||||
#else
|
#else
|
||||||
case EVENT_PMC_EMAIL:
|
case EVENT_PMC_EMAIL:
|
||||||
AddEmail( PMC_INTRO, PMC_INTRO_LENGTH, PMC, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
AddEmail(PMC_INTRO, PMC_INTRO_LENGTH, PMC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KERBERUS_OFFER);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -505,16 +503,14 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
gMercProfiles[MARIA].bMercStatus != MERC_IS_DEAD && gMercProfiles[ANGEL].bMercStatus != MERC_IS_DEAD )
|
gMercProfiles[MARIA].bMercStatus != MERC_IS_DEAD && gMercProfiles[ANGEL].bMercStatus != MERC_IS_DEAD )
|
||||||
{
|
{
|
||||||
StartQuest( QUEST_KINGPIN_ANGEL_MARIA, gWorldSectorX, gWorldSectorY );
|
StartQuest( QUEST_KINGPIN_ANGEL_MARIA, gWorldSectorX, gWorldSectorY );
|
||||||
|
AddEmail(KINGPIN_BOUNTY_INITIAL, KINGPIN_BOUNTY_INITIAL_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_JOBOPPORTUNITY);
|
||||||
AddEmail( KINGPIN_BOUNTY_INITIAL, KINGPIN_BOUNTY_INITIAL_LENGTH, KING_PIN, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVENT_KINGPIN_BOUNTY_END_KILLEDTHEM:
|
case EVENT_KINGPIN_BOUNTY_END_KILLEDTHEM:
|
||||||
if ( gMercProfiles[KINGPIN].bMercStatus != MERC_IS_DEAD && !CheckFact( FACT_KINGPIN_DEAD, NO_PROFILE ) && !CheckFact( FACT_KINGPIN_IS_ENEMY, NO_PROFILE ) )
|
if ( gMercProfiles[KINGPIN].bMercStatus != MERC_IS_DEAD && !CheckFact( FACT_KINGPIN_DEAD, NO_PROFILE ) && !CheckFact( FACT_KINGPIN_IS_ENEMY, NO_PROFILE ) )
|
||||||
{
|
{
|
||||||
AddEmail( KINGPIN_BOUNTY_KINGPIN_REWARD, KINGPIN_BOUNTY_KINGPIN_REWARD_LENGTH, KING_PIN, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
AddEmail(KINGPIN_BOUNTY_KINGPIN_REWARD, KINGPIN_BOUNTY_KINGPIN_REWARD_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_WELLDONE);
|
||||||
|
|
||||||
// also authorise payment from kingpin to the player
|
// also authorise payment from kingpin to the player
|
||||||
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin( ), 10000 );
|
AddTransactionToPlayersBook( ANONYMOUS_DEPOSIT, 0, GetWorldTotalMin( ), 10000 );
|
||||||
}
|
}
|
||||||
@@ -530,14 +526,13 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
if ( gMercProfiles[MARIA].bMercStatus != MERC_IS_DEAD && gMercProfiles[ANGEL].bMercStatus != MERC_IS_DEAD
|
if ( gMercProfiles[MARIA].bMercStatus != MERC_IS_DEAD && gMercProfiles[ANGEL].bMercStatus != MERC_IS_DEAD
|
||||||
&& CheckFact( FACT_BOUNTYHUNTER_KILLED_1, NO_PROFILE ) && CheckFact( FACT_BOUNTYHUNTER_KILLED_2, NO_PROFILE ) )
|
&& CheckFact( FACT_BOUNTYHUNTER_KILLED_1, NO_PROFILE ) && CheckFact( FACT_BOUNTYHUNTER_KILLED_2, NO_PROFILE ) )
|
||||||
{
|
{
|
||||||
AddEmail( KINGPIN_BOUNTY_ANGEL_THANKS, KINGPIN_BOUNTY_ANGEL_THANKS_LENGTH, ANGEL_DASILVA, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
AddEmail(KINGPIN_BOUNTY_ANGEL_THANKS, KINGPIN_BOUNTY_ANGEL_THANKS_LENGTH, ANGEL_DASILVA, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_DASILVA_THANKYOU);
|
||||||
|
AddEmail(KINGPIN_BOUNTY_TARGET_GOTAWAY, KINGPIN_BOUNTY_TARGET_GOTAWAY_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_FAILUREOBSTACLES);
|
||||||
AddEmail( KINGPIN_BOUNTY_TARGET_GOTAWAY, KINGPIN_BOUNTY_TARGET_GOTAWAY_LENGTH, KING_PIN, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
|
||||||
}
|
}
|
||||||
// we can assume that the bounty hunters for to them first - Kingpin sends an email and states that someone else finished the job
|
// we can assume that the bounty hunters for to them first - Kingpin sends an email and states that someone else finished the job
|
||||||
else if ( gMercProfiles[KINGPIN].bMercStatus != MERC_IS_DEAD && !CheckFact( FACT_KINGPIN_DEAD, NO_PROFILE ) && !CheckFact( FACT_KINGPIN_IS_ENEMY, NO_PROFILE ) )
|
else if ( gMercProfiles[KINGPIN].bMercStatus != MERC_IS_DEAD && !CheckFact( FACT_KINGPIN_DEAD, NO_PROFILE ) && !CheckFact( FACT_KINGPIN_IS_ENEMY, NO_PROFILE ) )
|
||||||
{
|
{
|
||||||
AddEmail( KINGPIN_BOUNTY_BH_GOTTARGET, KINGPIN_BOUNTY_BH_GOTTARGET_LENGTH, KING_PIN, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
AddEmail(KINGPIN_BOUNTY_BH_GOTTARGET, KINGPIN_BOUNTY_BH_GOTTARGET_LENGTH, KING_PIN, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_KINGPIN_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// in any case, this quest is now over
|
// in any case, this quest is now over
|
||||||
@@ -603,7 +598,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
|
|
||||||
#ifndef JA2UB
|
#ifndef JA2UB
|
||||||
case EVENT_MILITIAROSTER_EMAIL:
|
case EVENT_MILITIAROSTER_EMAIL:
|
||||||
AddEmail( MILITIAROSTER_INTRO, MILITIAROSTER_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
AddEmail(MILITIAROSTER_INTRO, MILITIAROSTER_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_MILITIA_WEBSITE);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -630,7 +625,7 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
|
|||||||
|
|
||||||
#ifndef JA2UB
|
#ifndef JA2UB
|
||||||
case EVENT_INTEL_ENRICO_EMAIL:
|
case EVENT_INTEL_ENRICO_EMAIL:
|
||||||
AddEmail( INTEL_ENRICO_INTRO, INTEL_ENRICO_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT );
|
AddEmail(INTEL_ENRICO_INTRO, INTEL_ENRICO_INTRO_LENGTH, MAIL_ENRICO, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT, XML_ENRICO_INTEL);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ BOOLEAN DeleteEventsWithDeletionPending()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AdjustClockToEventStamp( STRATEGICEVENT *pEvent, UINT32 *puiAdjustment )
|
static void AdjustClockToEventStamp( STRATEGICEVENT *pEvent, UINT32 *puiAdjustment )
|
||||||
{
|
{
|
||||||
UINT32 uiDiff;
|
UINT32 uiDiff;
|
||||||
|
|
||||||
|
|||||||
+7
-21
@@ -9,10 +9,8 @@
|
|||||||
#include "Soldier Profile.h"
|
#include "Soldier Profile.h"
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Game Init.h"
|
#include "Game Init.h"
|
||||||
#include "Animation Data.h"
|
|
||||||
#include "finances.h"
|
#include "finances.h"
|
||||||
#include "Soldier Create.h"
|
#include "Soldier Create.h"
|
||||||
#include "Soldier Init List.h"
|
|
||||||
#include "strategic.h"
|
#include "strategic.h"
|
||||||
#include "history.h"
|
#include "history.h"
|
||||||
#include "merc entering.h"
|
#include "merc entering.h"
|
||||||
@@ -31,12 +29,10 @@
|
|||||||
#include "Creature Spreading.h"
|
#include "Creature Spreading.h"
|
||||||
#include "Quests.h"
|
#include "Quests.h"
|
||||||
#include "Strategic AI.h"
|
#include "Strategic AI.h"
|
||||||
#include "LaptopSave.h"
|
|
||||||
#include "AimMembers.h"
|
#include "AimMembers.h"
|
||||||
#include "Dialogue Control.h"
|
#include "Dialogue Control.h"
|
||||||
#include "NPC.h"
|
#include "NPC.h"
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "interface Dialogue.h"
|
|
||||||
#include "Map Screen Interface Border.h"
|
#include "Map Screen Interface Border.h"
|
||||||
#include "Map Screen Helicopter.h"
|
#include "Map Screen Helicopter.h"
|
||||||
#include "Vehicles.h"
|
#include "Vehicles.h"
|
||||||
@@ -51,22 +47,17 @@
|
|||||||
// HEADROCK HAM 3.6: Include for adding facility debt reset
|
// HEADROCK HAM 3.6: Include for adding facility debt reset
|
||||||
#include "Facilities.h"
|
#include "Facilities.h"
|
||||||
// HEADROCK HAM 4: Include for initializing Manual Restrictions
|
// HEADROCK HAM 4: Include for initializing Manual Restrictions
|
||||||
#include "MilitiaSquads.h"
|
|
||||||
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
|
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
|
||||||
#include "CampaignStats.h" // added by Flugente
|
#include "CampaignStats.h" // added by Flugente
|
||||||
#include "PMC.h" // added by Flugente
|
#include "PMC.h" // added by Flugente
|
||||||
#include "ASD.h" // added by Flugente
|
|
||||||
#include "MiniEvents.h"
|
#include "MiniEvents.h"
|
||||||
#include "Rebel Command.h"
|
#include "Rebel Command.h"
|
||||||
#include "World Items.h"
|
#include "World Items.h"
|
||||||
|
|
||||||
#include "Vehicles.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "XML.h"
|
#include "XML.h"
|
||||||
#include "mercs.h"
|
#include "mercs.h"
|
||||||
#include "aim.h"
|
#include "aim.h"
|
||||||
#include "Map Screen Interface.h"
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
#include "Ja25 Strategic Ai.h"
|
#include "Ja25 Strategic Ai.h"
|
||||||
#include "Ja25_Tactical.h"
|
#include "Ja25_Tactical.h"
|
||||||
@@ -105,14 +96,14 @@ UINT8 gubCheatLevel = STARTING_CHEAT_LEVEL;
|
|||||||
UINT8 gubScreenCount=0;
|
UINT8 gubScreenCount=0;
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
void InitCustomStrategicLayer ( void )
|
static void InitCustomStrategicLayer ( void )
|
||||||
{
|
{
|
||||||
LetLuaGameInit(2); //load custom InitStrategicLayer
|
LetLuaGameInit(2); //load custom InitStrategicLayer
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void InitNPCs( void )
|
static void InitNPCs( void )
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef LUA_GAME_INIT_NPCS
|
#ifdef LUA_GAME_INIT_NPCS
|
||||||
@@ -842,19 +833,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 );
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-27
@@ -4,7 +4,6 @@
|
|||||||
#include "Strategic Mines.h"
|
#include "Strategic Mines.h"
|
||||||
#include "Campaign.h"
|
#include "Campaign.h"
|
||||||
#include "Morale.h"
|
#include "Morale.h"
|
||||||
#include "Quests.h"
|
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "jascreens.h"
|
#include "jascreens.h"
|
||||||
@@ -366,18 +365,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 +488,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 +616,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 +651,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 +668,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 +764,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 +798,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
|
||||||
@@ -909,7 +908,7 @@ void HourlyStealUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN RemoveItemInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT16 usItem, UINT32 usNumToRemove )
|
static BOOLEAN RemoveItemInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT16 usItem, UINT32 usNumToRemove )
|
||||||
{
|
{
|
||||||
UINT32 uiTotalNumberOfRealItems = 0;
|
UINT32 uiTotalNumberOfRealItems = 0;
|
||||||
std::vector<WORLDITEM> pWorldItem;//dnl ch75 271013
|
std::vector<WORLDITEM> pWorldItem;//dnl ch75 271013
|
||||||
@@ -985,7 +984,7 @@ BOOLEAN RemoveItemInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT1
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 CountAccessibleItemsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT16 usItem )
|
static UINT32 CountAccessibleItemsInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT16 usItem )
|
||||||
{
|
{
|
||||||
UINT32 numfound = 0;
|
UINT32 numfound = 0;
|
||||||
UINT32 uiTotalNumberOfRealItems = 0;
|
UINT32 uiTotalNumberOfRealItems = 0;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#ifdef JA2UB
|
||||||
#include "builddefines.h"
|
#include "builddefines.h"
|
||||||
|
|
||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
@@ -68,7 +69,6 @@
|
|||||||
#include "Auto Resolve.h"
|
#include "Auto Resolve.h"
|
||||||
#include "Cursors.h"
|
#include "Cursors.h"
|
||||||
|
|
||||||
#ifdef JA2UB
|
|
||||||
#include "Soldier Init List.h"
|
#include "Soldier Init List.h"
|
||||||
#include "Dialogue Control.h"
|
#include "Dialogue Control.h"
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
@@ -145,8 +145,6 @@ void InitJohnKulbaInitialSector();
|
|||||||
|
|
||||||
void FixEnemyCounterInSectorBug();
|
void FixEnemyCounterInSectorBug();
|
||||||
|
|
||||||
void AddEnemiesToFirstTunnelSector();
|
|
||||||
void AddEnemiesToSecondTunnelSector();
|
|
||||||
UINT8 NumEnemiesToAttackFirstTunnelSector( UINT8 *pAdmins, UINT8 *pTroops, UINT8 *pElites, UINT8 *pTanks, UINT8 *pJeeps, UINT8 *pRobots );
|
UINT8 NumEnemiesToAttackFirstTunnelSector( UINT8 *pAdmins, UINT8 *pTroops, UINT8 *pElites, UINT8 *pTanks, UINT8 *pJeeps, UINT8 *pRobots );
|
||||||
UINT8 NumEnemiesToAttackSecondTunnelSector( UINT8 *pAdmins, UINT8 *pTroops, UINT8 *pElites, UINT8 *pTanks, UINT8 *pJeeps, UINT8 *pRobots );
|
UINT8 NumEnemiesToAttackSecondTunnelSector( UINT8 *pAdmins, UINT8 *pTroops, UINT8 *pElites, UINT8 *pTanks, UINT8 *pJeeps, UINT8 *pRobots );
|
||||||
void RemoveAllEnemySoldierInitListLinks();
|
void RemoveAllEnemySoldierInitListLinks();
|
||||||
@@ -1247,7 +1245,6 @@ BOOLEAN LoadJa25SaveInfoFromSavedGame( HWFILE hFile )
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
gJa25SaveStruct.iPowerGenFanPositionSndID = -1;
|
|
||||||
|
|
||||||
return( TRUE );
|
return( TRUE );
|
||||||
}
|
}
|
||||||
@@ -1273,10 +1270,69 @@ void InitJa25StrategicAiBloodcats( )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static BOOLEAN AddEnemiesToSectorPlayerIsIn(INT16 sectorX, INT16 sectorY, INT8 sectorZ, UINT8 admins, UINT8 troops, UINT8 elites)
|
||||||
|
{
|
||||||
|
if ( gGameUBOptions.pJA2UB == TRUE )
|
||||||
|
{
|
||||||
|
|
||||||
|
if ( !(gTacticalStatus.uiFlags & INCOMBAT) )
|
||||||
|
{
|
||||||
|
SetEnemyEncounterCode(ENEMY_INVASION_CODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetNumberJa25EnemiesInSector(sectorX, sectorY, sectorZ, admins, troops, elites, 0, 0, 0);
|
||||||
|
|
||||||
|
SetThisSectorAsEnemyControlled(sectorX, sectorY, sectorZ, FALSE);
|
||||||
|
|
||||||
|
//Set up flag so enemies will go and find the player in that sector
|
||||||
|
gJa25SaveStruct.fEnemyShouldImmediatelySeekThePlayer = TRUE;
|
||||||
|
gJa25SaveStruct.bSectorTheEnemyWillSeekEnemy = SECTOR(sectorX, sectorY);
|
||||||
|
}
|
||||||
|
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void AddEnemiesToFirstTunnelSector()
|
||||||
|
{
|
||||||
|
const auto x1 = gGameUBOptions.Tunnel1_SectorX;
|
||||||
|
const auto y1 = gGameUBOptions.Tunnel1_SectorY;
|
||||||
|
const auto z1 = gGameUBOptions.Tunnel1_SectorZ;
|
||||||
|
|
||||||
|
UINT8 ubNumAdmins = 0;
|
||||||
|
UINT8 ubNumTroops = 0;
|
||||||
|
UINT8 ubNumElites = 0;
|
||||||
|
UINT8 ubNumTanks = 0;
|
||||||
|
UINT8 ubNumJeeps = 0;
|
||||||
|
UINT8 ubNumRobots = 0;
|
||||||
|
|
||||||
|
NumEnemiesToAttackFirstTunnelSector(&ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumTanks, &ubNumJeeps, &ubNumRobots);
|
||||||
|
SetNumberJa25EnemiesInSector(x1, y1, z1, ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks, ubNumJeeps, ubNumRobots);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void AddEnemiesToSecondTunnelSector()
|
||||||
|
{
|
||||||
|
const auto x2 = gGameUBOptions.Tunnel2_SectorX;
|
||||||
|
const auto y2 = gGameUBOptions.Tunnel2_SectorY;
|
||||||
|
const auto z2 = gGameUBOptions.Tunnel2_SectorZ;
|
||||||
|
|
||||||
|
UINT8 ubNumAdmins = 0;
|
||||||
|
UINT8 ubNumTroops = 0;
|
||||||
|
UINT8 ubNumElites = 0;
|
||||||
|
UINT8 ubNumTanks = 0;
|
||||||
|
UINT8 ubNumJeeps = 0;
|
||||||
|
UINT8 ubNumRobots = 0;
|
||||||
|
|
||||||
|
NumEnemiesToAttackSecondTunnelSector(&ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumTanks, &ubNumJeeps, &ubNumRobots);
|
||||||
|
SetNumberJa25EnemiesInSector(x2, y2, z2, ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks, ubNumJeeps, ubNumRobots);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void HandleAddingEnemiesToTunnelMaps()
|
void HandleAddingEnemiesToTunnelMaps()
|
||||||
{
|
{
|
||||||
BOOLEAN fInCombat = ( gTacticalStatus.uiFlags & INCOMBAT );
|
UINT8 ubNumEnemies = 0;
|
||||||
UINT8 ubNumEnemies=0;
|
UINT8 ubNumAdmins = 0;
|
||||||
|
UINT8 ubNumTroops = 0;
|
||||||
|
UINT8 ubNumElites = 0;
|
||||||
|
|
||||||
//if the player has been in the complex
|
//if the player has been in the complex
|
||||||
if( HaveMercsEverBeenInComplex() )
|
if( HaveMercsEverBeenInComplex() )
|
||||||
@@ -1285,21 +1341,35 @@ void HandleAddingEnemiesToTunnelMaps()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto x1 = gGameUBOptions.Tunnel1_SectorX;
|
||||||
|
const auto y1 = gGameUBOptions.Tunnel1_SectorY;
|
||||||
|
const auto z1 = gGameUBOptions.Tunnel1_SectorZ;
|
||||||
|
|
||||||
|
const auto x2 = gGameUBOptions.Tunnel2_SectorX;
|
||||||
|
const auto y2 = gGameUBOptions.Tunnel2_SectorY;
|
||||||
|
const auto z2 = gGameUBOptions.Tunnel2_SectorZ;
|
||||||
|
|
||||||
|
const bool isPlayerInFirstTunnel = AreAnyPlayerMercsStillInSector(x1, y1, z1);
|
||||||
|
const bool isPlayerInSecondTunnel = AreAnyPlayerMercsStillInSector(x2, y2, z2);
|
||||||
|
|
||||||
//if the player IS NOT in either of the tunnel sectors
|
//if the player IS NOT in either of the tunnel sectors
|
||||||
if( !AreAnyPlayerMercsStillInSector( 14, 10, 1 ) &&
|
if( !isPlayerInFirstTunnel && !isPlayerInSecondTunnel )
|
||||||
!AreAnyPlayerMercsStillInSector( 14, 11, 1 ) )
|
|
||||||
{
|
{
|
||||||
AddEnemiesToJa25TunnelMaps();
|
// Add enemies to both sectors if fan was blown up
|
||||||
|
if ( gJa25SaveStruct.ubHowPlayerGotThroughFan == PG__PLAYER_BLEW_UP_FAN_TO_GET_THROUGH )
|
||||||
|
{
|
||||||
|
AddEnemiesToFirstTunnelSector();
|
||||||
|
AddEnemiesToSecondTunnelSector();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//else if the player IS NOT in the 2nd sector but in the first sector
|
//else if the player IS NOT in the 2nd sector but is in the first sector
|
||||||
else if( AreAnyPlayerMercsStillInSector( 14, 10, 1 ) &&
|
else if( isPlayerInFirstTunnel && !isPlayerInSecondTunnel )
|
||||||
!AreAnyPlayerMercsStillInSector( 14, 11, 1 ) )
|
|
||||||
{
|
{
|
||||||
ubNumEnemies = NumEnemiesToAttackFirstTunnelSector( NULL, NULL, NULL, NULL, NULL, NULL );
|
ubNumEnemies = NumEnemiesToAttackFirstTunnelSector(&ubNumAdmins, &ubNumTroops, &ubNumElites, NULL, NULL, NULL );
|
||||||
|
|
||||||
//Add enemies to the first sector
|
//Add enemies to the first sector
|
||||||
HandleAddEnemiesToSectorPlayerIsntIn( JA25_J14_1, ubNumEnemies );
|
AddEnemiesToSectorPlayerIsIn( x1, y1, z1, ubNumAdmins, ubNumTroops, ubNumElites);
|
||||||
|
|
||||||
//Remember to move the enemies to be in the entrance to the tunnel
|
//Remember to move the enemies to be in the entrance to the tunnel
|
||||||
SetJa25GeneralFlag( JA_GF__MOVE_ENEMIES_TO_EDGE_IN_TUNNEL_1 );
|
SetJa25GeneralFlag( JA_GF__MOVE_ENEMIES_TO_EDGE_IN_TUNNEL_1 );
|
||||||
@@ -1308,58 +1378,17 @@ void HandleAddingEnemiesToTunnelMaps()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//else if the player is in the second sector
|
//else if the player is in the second sector
|
||||||
else if( AreAnyPlayerMercsStillInSector( 14, 11, 1 ) )
|
else if( isPlayerInSecondTunnel )
|
||||||
{
|
{
|
||||||
ubNumEnemies = NumEnemiesToAttackSecondTunnelSector( NULL, NULL, NULL, NULL, NULL, NULL );
|
ubNumEnemies = NumEnemiesToAttackSecondTunnelSector(&ubNumAdmins, &ubNumTroops, &ubNumElites, NULL, NULL, NULL );
|
||||||
|
|
||||||
//Add enemies to the first sector
|
AddEnemiesToSectorPlayerIsIn(x2, y2, z2, ubNumAdmins, ubNumTroops, ubNumElites);
|
||||||
HandleAddEnemiesToSectorPlayerIsntIn( JA25_K14_1, ubNumEnemies );
|
|
||||||
|
|
||||||
//Remember to move the enemies to be in the entrance to the tunnel
|
//Remember to move the enemies to be in the entrance to the tunnel
|
||||||
SetJa25GeneralFlag( JA_GF__MOVE_ENEMIES_TO_EDGE_IN_TUNNEL_2 );
|
SetJa25GeneralFlag( JA_GF__MOVE_ENEMIES_TO_EDGE_IN_TUNNEL_2 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddEnemiesToJa25TunnelMaps()
|
|
||||||
{
|
|
||||||
if( gJa25SaveStruct.ubHowPlayerGotThroughFan == PG__PLAYER_BLEW_UP_FAN_TO_GET_THROUGH )
|
|
||||||
{
|
|
||||||
//if the player blew up the fan, add a ton of enemies to the sector
|
|
||||||
AddEnemiesToFirstTunnelSector();
|
|
||||||
|
|
||||||
AddEnemiesToSecondTunnelSector();
|
|
||||||
}
|
|
||||||
else if( gJa25SaveStruct.ubHowPlayerGotThroughFan == PG__PLAYER_STOPPED_FAN_TO_GET_THROUGH )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddEnemiesToFirstTunnelSector()
|
|
||||||
{
|
|
||||||
UINT8 ubNumAdmins=0;
|
|
||||||
UINT8 ubNumTroops=0;
|
|
||||||
UINT8 ubNumElites=0;
|
|
||||||
UINT8 ubNumTanks=0;
|
|
||||||
UINT8 ubNumJeeps=0;
|
|
||||||
UINT8 ubNumRobots=0;
|
|
||||||
|
|
||||||
NumEnemiesToAttackFirstTunnelSector( &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumTanks, &ubNumJeeps, &ubNumRobots );
|
|
||||||
|
|
||||||
SetNumberJa25EnemiesInSector( 14, 10, 1, ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks, ubNumJeeps, ubNumRobots );
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddEnemiesToSecondTunnelSector()
|
|
||||||
{
|
|
||||||
UINT8 ubNumAdmins=0;
|
|
||||||
UINT8 ubNumTroops=0;
|
|
||||||
UINT8 ubNumElites=0;
|
|
||||||
UINT8 ubNumTanks=0;
|
|
||||||
UINT8 ubNumJeeps=0;
|
|
||||||
UINT8 ubNumRobots=0;
|
|
||||||
|
|
||||||
NumEnemiesToAttackSecondTunnelSector( &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumTanks, &ubNumJeeps, &ubNumRobots );
|
|
||||||
SetNumberJa25EnemiesInSector( 14, 11, 1, ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks, ubNumJeeps, ubNumRobots );
|
|
||||||
}
|
|
||||||
|
|
||||||
UINT8 NumEnemiesToAttackFirstTunnelSector( UINT8 *pAdmins, UINT8 *pTroops, UINT8 *pElites, UINT8 *pTanks, UINT8 *pJeeps, UINT8 *pRobots )
|
UINT8 NumEnemiesToAttackFirstTunnelSector( UINT8 *pAdmins, UINT8 *pTroops, UINT8 *pElites, UINT8 *pTanks, UINT8 *pJeeps, UINT8 *pRobots )
|
||||||
{
|
{
|
||||||
@@ -1389,6 +1418,11 @@ UINT8 NumEnemiesToAttackFirstTunnelSector( UINT8 *pAdmins, UINT8 *pTroops, UINT8
|
|||||||
ubNumTroops = 4 + Random( 0 );
|
ubNumTroops = 4 + Random( 0 );
|
||||||
ubNumElites = 4 + Random( 0 );
|
ubNumElites = 4 + Random( 0 );
|
||||||
break;
|
break;
|
||||||
|
case DIF_LEVEL_INSANE:
|
||||||
|
ubNumAdmins = 0 + Random(0);
|
||||||
|
ubNumTroops = 0 + Random(0);
|
||||||
|
ubNumElites = 8 + Random(0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pAdmins )
|
if( pAdmins )
|
||||||
@@ -1441,6 +1475,11 @@ UINT8 NumEnemiesToAttackSecondTunnelSector( UINT8 *pAdmins, UINT8 *pTroops, UINT
|
|||||||
ubNumTroops = 6 + Random( 0 );
|
ubNumTroops = 6 + Random( 0 );
|
||||||
ubNumElites = 4 + Random( 3 );
|
ubNumElites = 4 + Random( 3 );
|
||||||
break;
|
break;
|
||||||
|
case DIF_LEVEL_INSANE:
|
||||||
|
ubNumAdmins = 0 + Random(0);
|
||||||
|
ubNumTroops = 0 + Random(0);
|
||||||
|
ubNumElites = 10 + Random(0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pAdmins )
|
if( pAdmins )
|
||||||
|
|||||||
@@ -199,7 +199,6 @@ BOOLEAN SaveJa25SaveInfoToSaveGame( HWFILE hFile );
|
|||||||
BOOLEAN LoadJa25SaveInfoFromSavedGame( HWFILE hFile );
|
BOOLEAN LoadJa25SaveInfoFromSavedGame( HWFILE hFile );
|
||||||
|
|
||||||
|
|
||||||
void AddEnemiesToJa25TunnelMaps();
|
|
||||||
void HandleAddingEnemiesToTunnelMaps();
|
void HandleAddingEnemiesToTunnelMaps();
|
||||||
|
|
||||||
void SetJa25GeneralFlag( UINT32 uiFlagToSet );
|
void SetJa25GeneralFlag( UINT32 uiFlagToSet );
|
||||||
|
|||||||
+5401
-7190
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 );
|
||||||
|
|||||||
@@ -1,48 +1,41 @@
|
|||||||
#include "Map Screen Helicopter.h"
|
#include "Map Screen Helicopter.h"
|
||||||
#include "LaptopSave.h"
|
#include "LaptopSave.h"
|
||||||
#include "Vehicles.h"
|
|
||||||
#include "finances.h"
|
|
||||||
#include "Quests.h"
|
|
||||||
#include "Game Clock.h"
|
|
||||||
#include "strategic.h"
|
|
||||||
#include "Queen Command.h"
|
|
||||||
#include "Strategic Pathing.h"
|
|
||||||
#include "random.h"
|
|
||||||
#include "Game Event Hook.h"
|
|
||||||
#include "string.h"
|
|
||||||
#include "Dialogue Control.h"
|
|
||||||
#include "message.h"
|
|
||||||
#include "Strategic Movement.h"
|
|
||||||
#include "Soldier Profile.h"
|
|
||||||
#include "Assignments.h"
|
|
||||||
#include "PreBattle Interface.h"
|
|
||||||
#include "strategicmap.h"
|
|
||||||
#include "worlddef.h"
|
|
||||||
#include "worldman.h"
|
|
||||||
#include "TileDat.h"
|
|
||||||
#include "Map Screen Interface.h"
|
|
||||||
#include "Text.h"
|
|
||||||
#include "Squads.h"
|
|
||||||
#include "Player Command.h"
|
|
||||||
#include "Sound Control.h"
|
|
||||||
#include "GameSettings.h"
|
|
||||||
#include "Meanwhile.h"
|
|
||||||
#include "Map Screen Interface Border.h"
|
|
||||||
#include "Strategic Event Handler.h"
|
|
||||||
#include "Overhead.h"
|
|
||||||
#include "Soldier Create.h"
|
|
||||||
#include "renderworld.h"
|
|
||||||
#include "soundman.h"
|
|
||||||
#include "Isometric Utils.h"
|
|
||||||
#include "Scheduling.h"
|
|
||||||
// HEADROCK HAM 3.5: Added facility-based skyrider costs modifier
|
|
||||||
#include "Facilities.h"
|
|
||||||
#include "Debug Control.h"
|
|
||||||
#include "expat.h"
|
|
||||||
#include "merc entering.h" // added by Flugente
|
|
||||||
#include "ASD.h" // added by Flugente
|
|
||||||
|
|
||||||
#include "Vehicles.h"
|
#include "Vehicles.h"
|
||||||
|
#include "finances.h"
|
||||||
|
#include "Quests.h"
|
||||||
|
#include "Game Clock.h"
|
||||||
|
#include "strategic.h"
|
||||||
|
#include "Queen Command.h"
|
||||||
|
#include "Strategic Pathing.h"
|
||||||
|
#include "random.h"
|
||||||
|
#include "Game Event Hook.h"
|
||||||
|
#include "string.h"
|
||||||
|
#include "Dialogue Control.h"
|
||||||
|
#include "message.h"
|
||||||
|
#include "Strategic Movement.h"
|
||||||
|
#include "Soldier Profile.h"
|
||||||
|
#include "Assignments.h"
|
||||||
|
#include "strategicmap.h"
|
||||||
|
#include "worlddef.h"
|
||||||
|
#include "worldman.h"
|
||||||
|
#include "Map Screen Interface.h"
|
||||||
|
#include "Text.h"
|
||||||
|
#include "Squads.h"
|
||||||
|
#include "Sound Control.h"
|
||||||
|
#include "GameSettings.h"
|
||||||
|
#include "Meanwhile.h"
|
||||||
|
#include "Map Screen Interface Border.h"
|
||||||
|
#include "Overhead.h"
|
||||||
|
#include "Soldier Create.h"
|
||||||
|
#include "renderworld.h"
|
||||||
|
#include "Isometric Utils.h"
|
||||||
|
#include "Scheduling.h"
|
||||||
|
// HEADROCK HAM 3.5: Added facility-based skyrider costs modifier
|
||||||
|
#include "Facilities.h"
|
||||||
|
#include "Debug Control.h"
|
||||||
|
#include "expat.h"
|
||||||
|
#include "merc entering.h" // added by Flugente
|
||||||
|
#include "ASD.h" // added by Flugente
|
||||||
#include "NPC.h"
|
#include "NPC.h"
|
||||||
#include "history.h"
|
#include "history.h"
|
||||||
|
|
||||||
@@ -72,7 +65,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;
|
||||||
@@ -510,7 +503,7 @@ BOOLEAN ReadInHeliInfo(STR fileName)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN WriteInInfo(STR fileName)
|
static BOOLEAN WriteInInfo(STR fileName)
|
||||||
{
|
{
|
||||||
HWFILE hFile;
|
HWFILE hFile;
|
||||||
|
|
||||||
@@ -2446,7 +2439,7 @@ BOOLEAN WillAirRaidBeStopped( INT16 sSectorX, INT16 sSectorY )
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void HeliCrashSoundStopCallback( void *pData )
|
static void HeliCrashSoundStopCallback( void *pData )
|
||||||
{
|
{
|
||||||
SkyriderDestroyed( );
|
SkyriderDestroyed( );
|
||||||
}
|
}
|
||||||
@@ -2589,7 +2582,7 @@ BOOLEAN CanHelicopterTakeOff( void )
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddHeliPiece( INT32 iGridNo, UINT16 sOStruct )
|
static void AddHeliPiece( INT32 iGridNo, UINT16 sOStruct )
|
||||||
{
|
{
|
||||||
UINT16 usDummy;
|
UINT16 usDummy;
|
||||||
|
|
||||||
|
|||||||
@@ -11,21 +11,16 @@
|
|||||||
#include "mapscreen.h"
|
#include "mapscreen.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "Map Screen Interface Map.h"
|
#include "Map Screen Interface Map.h"
|
||||||
#include "Map Screen Interface Border.h"
|
|
||||||
#include "Map Screen Interface.h"
|
#include "Map Screen Interface.h"
|
||||||
#include "Map Screen Interface Map Inventory.h"
|
#include "Map Screen Interface Map Inventory.h"
|
||||||
#include "Map Screen Helicopter.h"
|
#include "Map Screen Helicopter.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Campaign Types.h"
|
|
||||||
#include "Strategic Town Loyalty.h"
|
|
||||||
#include "strategicmap.h"
|
|
||||||
#include "Assignments.h"
|
#include "Assignments.h"
|
||||||
// HEADROCK HAM 4: Now accepts INI settings
|
// HEADROCK HAM 4: Now accepts INI settings
|
||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
// Also include Quests, for checking whether a fact is true.
|
// Also include Quests, for checking whether a fact is true.
|
||||||
#include "Quests.h"
|
#include "Quests.h"
|
||||||
// HEADROCK HAM 5: Required for inventory filter popup
|
// HEADROCK HAM 5: Required for inventory filter popup
|
||||||
#include "popup_callback.h"
|
|
||||||
#include "popup_class.h"
|
#include "popup_class.h"
|
||||||
#include "Queen Command.h" // added by Flugente
|
#include "Queen Command.h" // added by Flugente
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,8 @@
|
|||||||
#include "Options Screen.h"
|
#include "Options Screen.h"
|
||||||
#include "Cursor Control.h"
|
#include "Cursor Control.h"
|
||||||
#include "gameloop.h"
|
#include "gameloop.h"
|
||||||
#include "ai.h"
|
|
||||||
#include "Tactical Save.h"
|
#include "Tactical Save.h"
|
||||||
#include "Campaign Types.h"
|
#include "Campaign Types.h"
|
||||||
#include "Air Raid.h"
|
|
||||||
#include "finances.h"
|
#include "finances.h"
|
||||||
#include "LaptopSave.h"
|
#include "LaptopSave.h"
|
||||||
#include "Interface Items.h"
|
#include "Interface Items.h"
|
||||||
@@ -1562,7 +1560,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 +1571,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 +1661,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 +1686,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 +1706,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 +1738,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 +2055,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
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "Map Screen Interface Map Inventory.h"
|
#include "Map Screen Interface Map Inventory.h"
|
||||||
#include "Render Dirty.h"
|
#include "Render Dirty.h"
|
||||||
#include "vobject.h"
|
#include "vobject.h"
|
||||||
#include "Utilities.h"
|
|
||||||
#include "WCheck.h"
|
#include "WCheck.h"
|
||||||
#include "sysutil.h"
|
#include "sysutil.h"
|
||||||
#include "Map Screen Interface Border.h"
|
#include "Map Screen Interface Border.h"
|
||||||
@@ -28,7 +27,6 @@
|
|||||||
#include "WordWrap.h"
|
#include "WordWrap.h"
|
||||||
#include "Soldier macros.h"
|
#include "Soldier macros.h"
|
||||||
#include "rt time defines.h"
|
#include "rt time defines.h"
|
||||||
#include "Encyclopedia_new.h" //Moa: item visibility
|
|
||||||
#include "Town Militia.h" // added by Flugente
|
#include "Town Militia.h" // added by Flugente
|
||||||
|
|
||||||
#include "ShopKeeper Interface.h"
|
#include "ShopKeeper Interface.h"
|
||||||
@@ -36,10 +34,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "InterfaceItemImages.h"
|
#include "InterfaceItemImages.h"
|
||||||
#include "SaveLoadGame.h"//dnl ch51 081009
|
#include "SaveLoadGame.h"//dnl ch51 081009
|
||||||
#include "Map Information.h"//dnl ch51 091009
|
|
||||||
#include "Interface Items.h"
|
|
||||||
#include "Food.h" // added by Flugente
|
#include "Food.h" // added by Flugente
|
||||||
#include "Campaign Types.h" // added by Flugente
|
|
||||||
#include "mapscreen.h"
|
#include "mapscreen.h"
|
||||||
|
|
||||||
//forward declarations of common classes to eliminate includes
|
//forward declarations of common classes to eliminate includes
|
||||||
@@ -201,7 +196,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 +678,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 +1175,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 +1211,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 +1344,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 +1362,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 +1385,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 +1471,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 +1481,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 +1594,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 +1632,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 +1649,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 +1658,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 +1673,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 +1717,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 +1795,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 +2471,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 +2575,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 +2643,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 +2660,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 +2674,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 +2689,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 +3015,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 +3047,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 +3072,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 +3525,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 +3641,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 +4816,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 +4958,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 +5007,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 +5082,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 +5155,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.
|
||||||
@@ -6023,7 +6024,10 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO
|
|||||||
FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ...
|
FLOAT newguntemperature = max(0.0f, guntemperature - tickspassed * cooldownfactor ); // ... calculate new temperature ...
|
||||||
|
|
||||||
#if JA2TESTVERSION
|
#if JA2TESTVERSION
|
||||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", guntemperature, newguntemperature);
|
if (guntemperature != newguntemperature)
|
||||||
|
{
|
||||||
|
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", guntemperature, newguntemperature);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(*itemStack)[i]->data.bTemperature = newguntemperature; // ... set new temperature
|
(*itemStack)[i]->data.bTemperature = newguntemperature; // ... set new temperature
|
||||||
@@ -6043,7 +6047,10 @@ void HandleItemCooldownFunctions( OBJECTTYPE* itemStack, INT32 deltaSeconds, BOO
|
|||||||
(*iter)[i]->data.bTemperature = newtemperature; // ... set new temperature
|
(*iter)[i]->data.bTemperature = newtemperature; // ... set new temperature
|
||||||
|
|
||||||
#if JA2TESTVERSION
|
#if JA2TESTVERSION
|
||||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature);
|
if (temperature != newtemperature)
|
||||||
|
{
|
||||||
|
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// we assume that there can exist only 1 underbarrel weapon per gun
|
// we assume that there can exist only 1 underbarrel weapon per gun
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
#include "Squads.h"
|
#include "Squads.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "Soldier Profile.h"
|
#include "Soldier Profile.h"
|
||||||
#include "Player Command.h"
|
|
||||||
#include "Strategic Movement.h"
|
#include "Strategic Movement.h"
|
||||||
#include "Queen Command.h"
|
#include "Queen Command.h"
|
||||||
#include "Campaign Types.h"
|
#include "Campaign Types.h"
|
||||||
@@ -28,7 +27,6 @@
|
|||||||
#include "Vehicles.h"
|
#include "Vehicles.h"
|
||||||
#include "Map Screen Helicopter.h"
|
#include "Map Screen Helicopter.h"
|
||||||
#include "Game Clock.h"
|
#include "Game Clock.h"
|
||||||
#include "finances.h"
|
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "english.h"
|
#include "english.h"
|
||||||
#include "PreBattle Interface.h"
|
#include "PreBattle Interface.h"
|
||||||
@@ -39,7 +37,6 @@
|
|||||||
#include "Tactical Save.h"
|
#include "Tactical Save.h"
|
||||||
#include "Map Information.h"
|
#include "Map Information.h"
|
||||||
#include "Air Raid.h"
|
#include "Air Raid.h"
|
||||||
#include "Auto Resolve.h"
|
|
||||||
#include "ASD.h" // added by Flugente
|
#include "ASD.h" // added by Flugente
|
||||||
#include "MilitiaIndividual.h" // added by Flugente
|
#include "MilitiaIndividual.h" // added by Flugente
|
||||||
#include "Map Screen Interface Map Inventory.h" // added by Flugente
|
#include "Map Screen Interface Map Inventory.h" // added by Flugente
|
||||||
@@ -50,10 +47,8 @@
|
|||||||
|
|
||||||
#include "Quests.h"
|
#include "Quests.h"
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
#include "Strategic Mines.h"
|
|
||||||
// HEADROCK HAM 3.5: included for detectionlevels
|
// HEADROCK HAM 3.5: included for detectionlevels
|
||||||
#include "Facilities.h"
|
#include "Facilities.h"
|
||||||
#include "MilitiaSquads.h"
|
|
||||||
|
|
||||||
#include "LaptopSave.h"
|
#include "LaptopSave.h"
|
||||||
#include <language.hpp>
|
#include <language.hpp>
|
||||||
@@ -476,10 +471,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 +518,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 +597,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 +1294,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 +1346,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 +4373,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 +4850,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 +6223,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 +6940,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 +7114,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 +8078,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;
|
||||||
|
|||||||
@@ -5,19 +5,15 @@
|
|||||||
#include "Queen Command.h"
|
#include "Queen Command.h"
|
||||||
#include "Player Command.h"
|
#include "Player Command.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
#include "Font.h"
|
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Map Screen Interface Map.h"
|
#include "Map Screen Interface Map.h"
|
||||||
#include "Map Screen Interface Border.h"
|
#include "Map Screen Interface Border.h"
|
||||||
#include "Handle UI.h"
|
|
||||||
#include "NPC.h"
|
|
||||||
#include "Strategic Town Loyalty.h"
|
#include "Strategic Town Loyalty.h"
|
||||||
#include "Strategic Mines.h"
|
#include "Strategic Mines.h"
|
||||||
#include "finances.h"
|
|
||||||
#include "Map Screen Interface Map Inventory.h"
|
#include "Map Screen Interface Map Inventory.h"
|
||||||
#include "strategic.h"
|
#include "strategic.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include "video.h"
|
#include <vsurface.h>
|
||||||
#include "Town Militia.h"
|
#include "Town Militia.h"
|
||||||
#include "HelpScreen.h"
|
#include "HelpScreen.h"
|
||||||
#include "Map Screen Helicopter.h"
|
#include "Map Screen Helicopter.h"
|
||||||
@@ -25,10 +21,7 @@
|
|||||||
#include "GameSettings.h"
|
#include "GameSettings.h"
|
||||||
#include "DEBUG.H"
|
#include "DEBUG.H"
|
||||||
#include "Overhead.h" // added by Flugente
|
#include "Overhead.h" // added by Flugente
|
||||||
#include "Game Clock.h" // added by Flugente
|
|
||||||
#include "Game Event Hook.h" // added by Flugente
|
|
||||||
|
|
||||||
#include "Strategic Mines.h"
|
|
||||||
|
|
||||||
#define BOX_BUTTON_WIDTH 100
|
#define BOX_BUTTON_WIDTH 100
|
||||||
#define BOX_BUTTON_HEIGHT 20
|
#define BOX_BUTTON_HEIGHT 20
|
||||||
@@ -180,11 +173,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 +542,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 +603,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
-176
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 );
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "Map Screen Interface.h"
|
#ifdef JA2UB
|
||||||
|
#include "Map Screen Interface.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "Map Screen Interface Map.h"
|
#include "Map Screen Interface Map.h"
|
||||||
#include "Font Control.h"
|
#include "Font Control.h"
|
||||||
@@ -47,7 +48,6 @@
|
|||||||
|
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
|
|
||||||
#ifdef JA2UB
|
|
||||||
|
|
||||||
#include "Ja25 Strategic Ai.h"
|
#include "Ja25 Strategic Ai.h"
|
||||||
#include "Ja25_Tactical.h"
|
#include "Ja25_Tactical.h"
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
#include "Soldier Profile.h"
|
#include "Soldier Profile.h"
|
||||||
#include "Overhead.h"
|
#include "Overhead.h"
|
||||||
#include "Dialogue Control.h"
|
#include "Dialogue Control.h"
|
||||||
#include "gameloop.h"
|
|
||||||
#include "NPC.h"
|
|
||||||
#include "Assignments.h"
|
#include "Assignments.h"
|
||||||
#include "strategic.h"
|
#include "strategic.h"
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
@@ -418,7 +416,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)
|
||||||
|
|||||||
+30
-41
@@ -9,8 +9,6 @@
|
|||||||
#include "Soldier Add.h"
|
#include "Soldier Add.h"
|
||||||
#include "Dialogue Control.h"
|
#include "Dialogue Control.h"
|
||||||
#include "Soldier Create.h"
|
#include "Soldier Create.h"
|
||||||
#include "message.h"
|
|
||||||
#include "Font Control.h"
|
|
||||||
#include "personnel.h"
|
#include "personnel.h"
|
||||||
#include "LaptopSave.h"
|
#include "LaptopSave.h"
|
||||||
#include "Map Screen Interface.h"
|
#include "Map Screen Interface.h"
|
||||||
@@ -18,8 +16,7 @@
|
|||||||
#include "strategicmap.h"
|
#include "strategicmap.h"
|
||||||
#include "Quests.h"
|
#include "Quests.h"
|
||||||
#include "worlddef.h"
|
#include "worlddef.h"
|
||||||
#include "Animation Control.h"
|
#include <Overhead.h>
|
||||||
#include "Tactical Save.h"
|
|
||||||
#include "Interface Control.h"
|
#include "Interface Control.h"
|
||||||
#include "gamescreen.h"
|
#include "gamescreen.h"
|
||||||
#include "jascreens.h"
|
#include "jascreens.h"
|
||||||
@@ -27,10 +24,8 @@
|
|||||||
#include "Assignments.h"
|
#include "Assignments.h"
|
||||||
#include "Strategic Movement.h"
|
#include "Strategic Movement.h"
|
||||||
#include "Squads.h"
|
#include "Squads.h"
|
||||||
#include "gameloop.h"
|
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Strategic Status.h"
|
#include "Strategic Status.h"
|
||||||
#include "mercs.h"
|
|
||||||
#include "insurance Contract.h"
|
#include "insurance Contract.h"
|
||||||
#include "Vehicles.h"
|
#include "Vehicles.h"
|
||||||
#include "email.h"
|
#include "email.h"
|
||||||
@@ -282,9 +277,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 +297,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 +737,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 &&
|
||||||
@@ -1111,10 +1102,12 @@ void CalculateMedicalDepositRefund( SOLDIERTYPE *pSoldier )
|
|||||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||||
{
|
{
|
||||||
if ( gGameUBOptions.fDeadMerc == TRUE )
|
if ( gGameUBOptions.fDeadMerc == TRUE )
|
||||||
AddEmailWithSpecialData( 27, AIM_MEDICAL_DEPOSIT_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L2 );
|
{
|
||||||
|
AddEmailWithSpecialData(27, AIM_MEDICAL_DEPOSIT_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L2, XML_AIM_REFUND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
AddEmailWithSpecialData( AIM_MEDICAL_DEPOSIT_REFUND, AIM_MEDICAL_DEPOSIT_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(AIM_MEDICAL_DEPOSIT_REFUND, AIM_MEDICAL_DEPOSIT_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_AIM_REFUND);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
//else if the merc is a dead, refund NOTHING!!
|
//else if the merc is a dead, refund NOTHING!!
|
||||||
@@ -1125,14 +1118,15 @@ void CalculateMedicalDepositRefund( SOLDIERTYPE *pSoldier )
|
|||||||
|
|
||||||
//add an email
|
//add an email
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
//no UB
|
|
||||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||||
{
|
{
|
||||||
if ( gGameUBOptions.fDeadMerc == TRUE )
|
if ( gGameUBOptions.fDeadMerc == TRUE )
|
||||||
AddEmailWithSpecialData( 217, AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L3 );
|
{
|
||||||
|
AddEmailWithSpecialData(217, AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L3, XML_AIM_NOREFUND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
AddEmailWithSpecialData( AIM_MEDICAL_DEPOSIT_NO_REFUND, AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(AIM_MEDICAL_DEPOSIT_NO_REFUND, AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), pSoldier->usMedicalDeposit, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_AIM_NOREFUND);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
//else the player is injured, refund a partial amount
|
//else the player is injured, refund a partial amount
|
||||||
@@ -1150,10 +1144,12 @@ void CalculateMedicalDepositRefund( SOLDIERTYPE *pSoldier )
|
|||||||
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
|
||||||
{
|
{
|
||||||
if ( gGameUBOptions.fDeadMerc == TRUE )
|
if ( gGameUBOptions.fDeadMerc == TRUE )
|
||||||
AddEmailWithSpecialData( 214, AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), iRefundAmount, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L4 );
|
{
|
||||||
|
AddEmailWithSpecialData(214, AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), iRefundAmount, pSoldier->ubProfile, TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT, TYPE_E_AIM_L4, XML_AIM_PARTIALREFUND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
AddEmailWithSpecialData( AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND, AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), iRefundAmount, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
|
AddEmailWithSpecialData(AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND, AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH, AIM_SITE, GetWorldTotalMin(), iRefundAmount, pSoldier->ubProfile, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE, XML_AIM_PARTIALREFUND);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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 );
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user