Rise
The Vieneo Province
Loading...
Searching...
No Matches
Intermedia.cpp
Go to the documentation of this file.
1#include "../Instrument.h"
2#include "../../Bus.h"
3
4Intermedia::Intermedia(int prmX, int prmY, float prmXScale, float prmYScale, Bus* prmBus, Logger* prmLogger, DeviceObject* prmDevice, std::vector<Font*> prmFonts) :
5 Instrument(prmX, prmY, prmXScale, prmYScale, prmBus, prmLogger, prmDevice, prmFonts)
6{
7 logger->AddToCallStack("Intermedia::ctor");
8 defaultFont = 1;
9
10 mine = new Sprite(logger, pDevice, "Textures/mine.png", prmX, prmY, 0.0f, 0, 0, 421, 320, 0xFFFFFFFF);
11 x = prmX + 5;
12}
13
15{
16 WCHAR str[99];
17
18 if (!interactive.avail)
19 {
20 DrawTextW(L"INTERMEDIA PROXIMITY MENU UNAVAILABLE", 0, 0, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
21 return;
22 }
23
24 mine->Draw();
25
26 if (interactive.menutype == 1 || interactive.menutype == 13) // mining expansion/demolition
27 {
28 float gradeadj = 1.0f + powf(interactive.tempplot.grade * 0.01f, 2.0f) * 63.0f;
29 if (interactive.menutype == 13)
30 gradeadj *= 0.2625f;
31 if (interactive.tempplot.constructime == 0L)
32 {
33 if (interactive.menutype == 1)
34 {
35 swprintf_s(str, 99,
36 L" Availability for construction %7i MT common %3i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
37 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
38 swprintf_s(str, 99,
39 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
40 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
41 }
42 else
43 {
44 swprintf_s(str, 99,
45 L" Availability for demolition %7i MT common %3i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
46 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
47 swprintf_s(str, 99,
48 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
49 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
50 }
51 }
52 else
53 {
54 char timerem[99];
55 if (interactive.tempplot.constructime > 103896L)
56 sprintf_s(timerem, sizeof(timerem), "%5i days left ", interactive.tempplot.constructime / 51948L); // vieneo days
57 else if (interactive.tempplot.constructime > 3600L)
58 sprintf_s(timerem, sizeof(timerem), "%5i hours left ", interactive.tempplot.constructime / 3600L);
59 else if (interactive.tempplot.constructime > 60L)
60 sprintf_s(timerem, sizeof(timerem), "%5i minutes left", interactive.tempplot.constructime / 60L);
61 else
62 sprintf_s(timerem, sizeof(timerem), "One minute left!");
63
64 swprintf_s(str, 99,
65 L" CONSTRUCTION IN PROGRESS %S (%i colonists building)", timerem, interactive.tempplot.colonistsbuilding);
66 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
67 }
68
69 if (interactive.menutype == 1)
70 {
71 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Needed Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
72 }
73 else
74 {
75 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Recycled Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
76 }
77 swprintf_s(str, 99,
78 L"1] Mining Command %-4i 1 29 colonists %3.0f MT common 19 labor", interactive.type1built, ceilf(195.0f * gradeadj));
79 DrawTextW(str, 0, 50, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
80 swprintf_s(str, 99,
81 L" 116 MT storage %3.0f MT fabricated", ceilf(143.0f * gradeadj));
82 DrawTextW(str, 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
83
84 swprintf_s(str, 99,
85 L"2] Extraction %-4i 11 11 MT daily %3.0f MT common 4 labor", interactive.type2built, ceilf(14.0f * gradeadj));
86 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
87 swprintf_s(str, 99,
88 L" %3.0f MT fabricated", ceilf(9.0f * gradeadj));
89 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
90
91 swprintf_s(str, 99,
92 L"3] Raw Material Storage %-4i 1 3413 MT storage %3.0f MT common 8 labor", interactive.type3built, ceilf(108.0f * gradeadj));
93 DrawTextW(str, 0, 100, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
94
95 swprintf_s(str, 99,
96 L"4] Separator %-4i 1 110 MT daily %3.0f MT common 13 labor", interactive.type4built, ceilf(392.0f * gradeadj));
97 DrawTextW(str, 0, 125, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
98 swprintf_s(str, 99,
99 L" %3.0f MT fabricated", ceilf(201.0f * gradeadj));
100 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
101
102 swprintf_s(str, 99,
103 L"5] Material Obliteration %-4i 1 240 MT daily %3.0f MT common 16 labor", interactive.type5built, ceilf(227.0f * gradeadj));
104 DrawTextW(str, 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
105 swprintf_s(str, 99,
106 L" 1 colonist %3.0f MT fabricated", ceilf(124.0f * gradeadj));
107 DrawTextW(str, 0, 160, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
108
109 swprintf_s(str, 99,
110 L"6] Processed Storage %-4i 7 3413 MT storage %3.0f MT common 8 labor", interactive.type6built, ceilf(108.0f * gradeadj));
111 DrawTextW(str, 0, 175, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
112 swprintf_s(str, 99,
113 L" 1 colonist");
114 DrawTextW(str, 0, 185, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
115
116 swprintf_s(str, 99,
117 L"7] Support Structures %-4i 17 17 colonists %3.0f MT common 12 labor", interactive.type7built, ceilf(132.0f * gradeadj));
118 DrawTextW(str, 0, 200, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
119 swprintf_s(str, 99,
120 L" %3.0f MT fabricated", ceilf(99.0f * gradeadj));
121 DrawTextW(str, 0, 210, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
122
123 swprintf_s(str, 99,
124 L"8] Power Production %-4i 1 848 GJ daily %3.0f MT common 4 labor", interactive.type8built, ceilf(132.0f * gradeadj));
125 DrawTextW(str, 0, 225, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
126 swprintf_s(str, 99,
127 L" 1 colonist %3.0f MT fabricated", ceilf(99.0f * gradeadj));
128 DrawTextW(str, 0, 235, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
129
130 swprintf_s(str, 99,
131 L"9] Defensive Platforms %-4i 3 4 GJ/burst %3.0f MT common 6 labor", interactive.type9built, ceilf(132.0f * gradeadj));
132 DrawTextW(str, 0, 250, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
133 swprintf_s(str, 99,
134 L" 1 colonist %3.0f MT fabricated", ceilf(99.0f * gradeadj));
135 DrawTextW(str, 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
136 }
137 else if (interactive.menutype == 2 || interactive.menutype == 3) // storefront
138 {
139 // 2 is manager/trade, 3 is customer
140 if (interactive.menutype == 2)
141 {
142 DrawTextW(L" Manage Storefront (select commodity for advanced options)", 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
143
144 swprintf_s(str, 99, L"1] Cash (%.0f CR)", floorf(interactive.tempplot.cashbalance));
145 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
146 }
147 else
148 {
149 if (interactive.tempplot.discount)
150 swprintf_s(str, 99, L"1] Fleet Bank ATM Discount: %i%%", interactive.tempplot.discount);
151 else
152 swprintf_s(str, 99, L"1] Fleet Bank ATM");
153 if (interactive.tempplot.ATMcharge > -1)
154 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
155 else
156 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFF505050);
157 }
158
159 DrawTextW(L" Commodity Type Selling Buying", 0, 45, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
160
161 WCHAR buyat[50], sellat[50];
162 long buypos, sellpos, maxpos;
163 long spaceavail = interactive.tempplot.maxprocstor -
164 (long)(interactive.tempplot.procstorA + interactive.tempplot.procstorfood + interactive.tempplot.procstorC + interactive.tempplot.procstorfuelore + interactive.tempplot.procstorgoods + interactive.tempplot.procstormaterials + interactive.tempplot.procstorfuel);
165 if (spaceavail < 0)
166 spaceavail = 0;
167
168 if (interactive.tempplot.buyA > 0)
169 buypos = (long)interactive.tempplot.cashbalance / (long)interactive.tempplot.buyA;
170 else
171 buypos = 0L;
172 maxpos = (long)interactive.tempplot.maxA - (long)interactive.tempplot.procstorA;
173 maxpos = RiseMath::Min(maxpos, spaceavail);
174 if (buypos > maxpos)
175 buypos = maxpos;
176 if (buypos > 30000L)
177 buypos = 30000L;
178 if (buypos < 0L)
179 buypos = 0L;
180 if (buypos > 0)
181 swprintf_s(buyat, 50, L"%5i MT @ %5i CR/MT", buypos, interactive.tempplot.buyA);
182 else
183 wcscpy_s(buyat, 50, L"Not trading...");
184 sellpos = (long)interactive.tempplot.procstorA - (long)interactive.tempplot.minA;
185 if (sellpos > 30000L)
186 sellpos = 30000L;
187 if (sellpos < 0L)
188 sellpos = 0L;
189 if (sellpos > 0 && interactive.tempplot.sellA > 0)
190 swprintf_s(sellat, 50, L"%5i MT @ %5i CR/MT", sellpos, interactive.tempplot.sellA);
191 else
192 wcscpy_s(sellat, 50, L"Not trading...");
193 swprintf_s(str, 99, L"2] Rare/Precious %22s %22s", sellat, buyat);
194 DrawTextW(str, 0, 70, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
195
196 if (interactive.tempplot.buyB > 0)
197 buypos = (long)interactive.tempplot.cashbalance / (long)interactive.tempplot.buyB;
198 else
199 buypos = 0L;
200 maxpos = (long)interactive.tempplot.maxB - (long)interactive.tempplot.procstorfood;
201 maxpos = RiseMath::Min(maxpos, spaceavail);
202 if (buypos > maxpos)
203 buypos = maxpos;
204 if (buypos > 30000L)
205 buypos = 30000L;
206 if (buypos < 0L)
207 buypos = 0L;
208 if (buypos > 0)
209 swprintf_s(buyat, 50, L"%5i MT @ %5i CR/MT", buypos, interactive.tempplot.buyB);
210 else
211 wcscpy_s(buyat, 50, L"Not trading...");
212 sellpos = (long)interactive.tempplot.procstorfood - (long)interactive.tempplot.minB;
213 if (sellpos > 30000L)
214 sellpos = 30000L;
215 if (sellpos < 0L)
216 sellpos = 0L;
217 if (sellpos > 0 && interactive.tempplot.sellB > 0)
218 swprintf_s(sellat, 50, L"%5i MT @ %5i CR/MT", sellpos, interactive.tempplot.sellB);
219 else
220 wcscpy_s(sellat, 50, L"Not trading...");
221 swprintf_s(str, 99, L"3] Foodstuffs %22s %22s", sellat, buyat);
222 DrawTextW(str, 0, 95, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
223
224 if (interactive.tempplot.buyC > 0)
225 buypos = (long)interactive.tempplot.cashbalance / (long)interactive.tempplot.buyC;
226 else
227 buypos = 0L;
228 maxpos = (long)interactive.tempplot.maxC - (long)interactive.tempplot.procstorC;
229 maxpos = RiseMath::Min(maxpos, spaceavail);
230 if (buypos > maxpos)
231 buypos = maxpos;
232 if (buypos > 30000L)
233 buypos = 30000L;
234 if (buypos < 0L)
235 buypos = 0L;
236 if (buypos > 0)
237 swprintf_s(buyat, 50, L"%5i MT @ %5i CR/MT", buypos, interactive.tempplot.buyC);
238 else
239 wcscpy_s(buyat, 50, L"Not trading...");
240 sellpos = (long)interactive.tempplot.procstorC - (long)interactive.tempplot.minC;
241 if (sellpos > 30000L)
242 sellpos = 30000L;
243 if (sellpos < 0L)
244 sellpos = 0L;
245 if (sellpos > 0 && interactive.tempplot.sellC > 0)
246 swprintf_s(sellat, 50, L"%5i MT @ %5i CR/MT", sellpos, interactive.tempplot.sellC);
247 else
248 wcscpy_s(sellat, 50, L"Not trading...");
249 swprintf_s(str, 99, L"4] Common Materials %22s %22s", sellat, buyat);
250 DrawTextW(str, 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
251
252 if (interactive.tempplot.buyD > 0)
253 buypos = (long)interactive.tempplot.cashbalance / (long)interactive.tempplot.buyD;
254 else
255 buypos = 0L;
256 maxpos = (long)interactive.tempplot.maxD - (long)interactive.tempplot.procstorfuelore;
257 maxpos = RiseMath::Min(maxpos, spaceavail);
258 if (buypos > maxpos)
259 buypos = maxpos;
260 if (buypos > 30000L)
261 buypos = 30000L;
262 if (buypos < 0L)
263 buypos = 0L;
264 if (buypos > 0)
265 swprintf_s(buyat, 50, L"%5i MT @ %5i CR/MT", buypos, interactive.tempplot.buyD);
266 else
267 wcscpy_s(buyat, 50, L"Not trading...");
268 sellpos = (long)interactive.tempplot.procstorfuelore - (long)interactive.tempplot.minD;
269 if (sellpos > 30000L)
270 sellpos = 30000L;
271 if (sellpos < 0L)
272 sellpos = 0L;
273 if (sellpos > 0 && interactive.tempplot.sellD > 0)
274 swprintf_s(sellat, 50, L"%5i MT @ %5i CR/MT", sellpos, interactive.tempplot.sellD);
275 else
276 wcscpy_s(sellat, 50, L"Not trading...");
277 swprintf_s(str, 99, L"5] Fuel Ore %22s %22s", sellat, buyat);
278 DrawTextW(str, 0, 145, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
279
280 if (interactive.tempplot.buyE > 0)
281 buypos = (long)interactive.tempplot.cashbalance / (long)interactive.tempplot.buyE;
282 else
283 buypos = 0L;
284 maxpos = (long)interactive.tempplot.maxE - (long)interactive.tempplot.procstorgoods;
285 maxpos = RiseMath::Min(maxpos, spaceavail);
286 if (buypos > maxpos)
287 buypos = maxpos;
288 if (buypos > 30000L)
289 buypos = 30000L;
290 if (buypos < 0L)
291 buypos = 0L;
292 if (buypos > 0)
293 swprintf_s(buyat, 50, L"%5i MT @ %5i CR/MT", buypos, interactive.tempplot.buyE);
294 else
295 wcscpy_s(buyat, 50, L"Not trading...");
296 sellpos = (long)interactive.tempplot.procstorgoods - (long)interactive.tempplot.minE;
297 if (sellpos > 30000L)
298 sellpos = 30000L;
299 if (sellpos < 0L)
300 sellpos = 0L;
301 if (sellpos > 0 && interactive.tempplot.sellE > 0)
302 swprintf_s(sellat, 50, L"%5i MT @ %5i CR/MT", sellpos, interactive.tempplot.sellE);
303 else
304 wcscpy_s(sellat, 50, L"Not trading...");
305 swprintf_s(str, 99, L"6] Consumer Goods %22s %22s", sellat, buyat);
306 DrawTextW(str, 0, 170, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
307
308 if (interactive.tempplot.buyF > 0)
309 buypos = (long)interactive.tempplot.cashbalance / (long)interactive.tempplot.buyF;
310 else
311 buypos = 0L;
312 maxpos = (long)interactive.tempplot.maxF - (long)interactive.tempplot.procstormaterials;
313 maxpos = RiseMath::Min(maxpos, spaceavail);
314 if (buypos > maxpos)
315 buypos = maxpos;
316 if (buypos > 30000L)
317 buypos = 30000L;
318 if (buypos < 0L)
319 buypos = 0L;
320 if (buypos > 0)
321 swprintf_s(buyat, 50, L"%5i MT @ %5i CR/MT", buypos, interactive.tempplot.buyF);
322 else
323 wcscpy_s(buyat, 50, L"Not trading...");
324 sellpos = (long)interactive.tempplot.procstormaterials - (long)interactive.tempplot.minF;
325 if (sellpos > 30000L)
326 sellpos = 30000L;
327 if (sellpos < 0L)
328 sellpos = 0L;
329 if (sellpos > 0 && interactive.tempplot.sellF > 0)
330 swprintf_s(sellat, 50, L"%5i MT @ %5i CR/MT", sellpos, interactive.tempplot.sellF);
331 else
332 wcscpy_s(sellat, 50, L"Not trading...");
333 swprintf_s(str, 99, L"7] Fabricated Material %22s %22s", sellat, buyat);
334 DrawTextW(str, 0, 195, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
335
336 if (interactive.tempplot.buyG > 0)
337 buypos = (long)interactive.tempplot.cashbalance / (long)interactive.tempplot.buyG;
338 else
339 buypos = 0L;
340 maxpos = (long)interactive.tempplot.maxG - (long)interactive.tempplot.procstorfuel;
341 maxpos = RiseMath::Min(maxpos, spaceavail);
342 if (buypos > maxpos)
343 buypos = maxpos;
344 if (buypos > 30000L)
345 buypos = 30000L;
346 if (buypos < 0L)
347 buypos = 0L;
348 if (buypos > 0)
349 swprintf_s(buyat, 50, L"%5i MT @ %5i CR/MT", buypos, interactive.tempplot.buyG);
350 else
351 wcscpy_s(buyat, 50, L"Not trading...");
352 sellpos = (long)interactive.tempplot.procstorfuel - (long)interactive.tempplot.minG;
353 if (sellpos > 30000L)
354 sellpos = 30000L;
355 if (sellpos < 0L)
356 sellpos = 0L;
357 if (sellpos > 0 && interactive.tempplot.sellG > 0)
358 swprintf_s(sellat, 50, L"%5i MT @ %5i CR/MT", sellpos, interactive.tempplot.sellG);
359 else
360 wcscpy_s(sellat, 50, L"Not trading...");
361 swprintf_s(str, 99, L"8] Iagreous Fuel %22s %22s", sellat, buyat);
362 DrawTextW(str, 0, 220, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
363 }
364 else if (interactive.menutype == 4) // cargo ops
365 {
366 swprintf_s(str, 99, L" Cargo Operations %.0f of %i MT in storage", ceilf(interactive.tempplot.procstorA + interactive.tempplot.procstorfood + interactive.tempplot.procstorC + interactive.tempplot.procstorfuelore + interactive.tempplot.procstorgoods + interactive.tempplot.procstormaterials + interactive.tempplot.procstorfuel), interactive.tempplot.maxprocstor);
367 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
368
369 DrawTextW(L" Commodity Type Inventory Units", 0, 30, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
370
371 swprintf_s(str, 99, L"1] Rare/Precious %-9.0f MT", floorf(interactive.tempplot.procstorA));
372 DrawTextW(str, 0, 70, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
373
374 swprintf_s(str, 99, L"2] Foodstuffs %-9.0f MT", floorf(interactive.tempplot.procstorfood));
375 DrawTextW(str, 0, 95, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
376
377 swprintf_s(str, 99, L"3] Common Materials %-9.0f MT", floorf(interactive.tempplot.procstorC));
378 DrawTextW(str, 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
379
380 swprintf_s(str, 99, L"4] Fuel Ore %-9.0f MT", floorf(interactive.tempplot.procstorfuelore));
381 DrawTextW(str, 0, 145, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
382
383 swprintf_s(str, 99, L"5] Consumer Goods %-9.0f MT", floorf(interactive.tempplot.procstorgoods));
384 DrawTextW(str, 0, 170, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
385
386 swprintf_s(str, 99, L"6] Fabricated Materials %-9.0f MT", floorf(interactive.tempplot.procstormaterials));
387 DrawTextW(str, 0, 195, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
388
389 swprintf_s(str, 99, L"7] Iagreous Fuel %-9.0f MT", floorf(interactive.tempplot.procstorfuel));
390 DrawTextW(str, 0, 220, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
391 }
392 else if (interactive.menutype == 5 || interactive.menutype == 14) // farming expansions
393 {
394 float gradeadj = 1.0f + powf(interactive.tempplot.grade * 0.01f, 2.0f) * 63.0f;
395 if (interactive.menutype == 14)
396 gradeadj *= 0.2625f;
397 if (interactive.tempplot.constructime == 0L)
398 {
399 if (interactive.menutype == 5)
400 {
401 swprintf_s(str, 99,
402 L" Availability for construction %7i MT common %i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
403 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
404 swprintf_s(str, 99,
405 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
406 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
407 }
408 else
409 {
410 swprintf_s(str, 99,
411 L" Availability for demolition %7i MT common %i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
412 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
413 swprintf_s(str, 99,
414 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
415 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
416 }
417 }
418 else
419 {
420 char timerem[99];
421 if (interactive.tempplot.constructime > 103896L)
422 sprintf_s(timerem, sizeof(timerem), "%5i days left ", interactive.tempplot.constructime / 51948L); // vieneo days
423 else if (interactive.tempplot.constructime > 3600L)
424 sprintf_s(timerem, sizeof(timerem), "%5i hours left ", interactive.tempplot.constructime / 3600L);
425 else if (interactive.tempplot.constructime > 60L)
426 sprintf_s(timerem, sizeof(timerem), "%5i minutes left", interactive.tempplot.constructime / 60L);
427 else
428 sprintf_s(timerem, sizeof(timerem), "One minute left!");
429
430 swprintf_s(str, 99,
431 L" CONSTRUCTION IN PROGRESS %S (%i colonists building)", timerem, interactive.tempplot.colonistsbuilding);
432 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
433 }
434
435 if (interactive.menutype == 5)
436 {
437 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Needed Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
438 }
439 else
440 {
441 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Recycled Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
442 }
443 swprintf_s(str, 99,
444 L"1] Farmstead %-4i 1 22 colonists %5.0f MT common 2 labor", interactive.type1built, ceilf(64.0f * gradeadj));
445 DrawTextW(str, 0, 50, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
446 swprintf_s(str, 99,
447 L" 34 MT storage %5.0f MT fabricated", ceilf(47.0f * gradeadj));
448 DrawTextW(str, 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
449
450 swprintf_s(str, 99,
451 L"2] Algae Farms %-4i 21 1 MT yearly %5.0f MT common 1 labor", interactive.type2built, 0.0f);
452 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
453 swprintf_s(str, 99,
454 L" %5.0f MT fabricated", 0.0f);
455 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
456
457 swprintf_s(str, 99,
458 L"3] Greenhouses %-4i 3 21 MT yearly %5.0f MT common 3 labor", interactive.type3built, ceilf(196.0f * gradeadj));
459 DrawTextW(str, 0, 100, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
460 swprintf_s(str, 99,
461 L" %5.0f MT fabricated", ceilf(101.0f * gradeadj));
462 DrawTextW(str, 0, 110, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
463
464 swprintf_s(str, 99,
465 L"4] Hydroponics %-4i 2 35 MT yearly %5.0f MT common 5 labor", interactive.type4built, ceilf(392.0f * gradeadj));
466 DrawTextW(str, 0, 125, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
467 swprintf_s(str, 99,
468 L" %5.0f MT fabricated", ceilf(201.0f * gradeadj));
469 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
470
471 swprintf_s(str, 99,
472 L"5] Storage Silos %-4i 3 3413 MT storage %5.0f MT common 8 labor", interactive.type6built, ceilf(108.0f * gradeadj));
473 DrawTextW(str, 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
474 swprintf_s(str, 99,
475 L" 1 colonist %5.0f MT fabricated", ceilf(81.0f * gradeadj));
476 DrawTextW(str, 0, 160, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
477
478 swprintf_s(str, 99,
479 L"6] Support Structures %-4i 4 1 colonist %5.0f MT common 12 labor", interactive.type7built, ceilf(132.0f * gradeadj));
480 DrawTextW(str, 0, 175, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
481 swprintf_s(str, 99,
482 L" %5.0f MT fabricated", ceilf(99.0f * gradeadj));
483 DrawTextW(str, 0, 185, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
484
485 swprintf_s(str, 99,
486 L"7] Defensive Platforms %-4i 1 4 GJ/burst %5.0f MT common 6 labor", interactive.type9built, ceilf(132.0f * gradeadj));
487 DrawTextW(str, 0, 200, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
488 swprintf_s(str, 99,
489 L" 1 colonist %5.0f MT fabricated", ceilf(99.0f * gradeadj));
490 DrawTextW(str, 0, 210, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
491 }
492 else if (interactive.menutype == 6) // mining command
493 {
494 if (interactive.tempplot.colonyName[0] == 0)
495 {
496 if (interactive.tempplot.boundaryName[0] == 0)
497 swprintf_s(str, 99, L" Welcome! (population %.0f)", floorf(interactive.tempplot.totalPopulation));
498 else
499 swprintf_s(str, 99, L" Welcome to %S! (population %.0f)", interactive.tempplot.boundaryName, floorf(interactive.tempplot.totalPopulation));
500 }
501 else
502 {
503 if (interactive.tempplot.boundaryName[0] == 0)
504 swprintf_s(str, 99, L" Welcome to %S (population %.0f)", interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
505 else
506 swprintf_s(str, 99, L" Welcome to %S %S (population %.0f)", interactive.tempplot.boundaryName, interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
507 }
508 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
509
510 float opeff;
511 if (interactive.tempplot.workingPopulation >= 1.0f && interactive.mincoltorun > 0.0f)
512 {
513 opeff = (interactive.tempplot.workingPopulation - static_cast<float>(interactive.tempplot.colonistsbuilding)) / interactive.mincoltorun;
514 if (opeff > 1.0f)
515 opeff = 1.0f;
516 else if (opeff < 0.0f)
517 opeff = 0.0f;
518 opeff *= 0.5f + static_cast<float>(interactive.type7built) / 17.0f; // half as efficient to 1.5 times as efficient
519 }
520 else
521 opeff = 0.0f;
522
523 swprintf_s(str, 99,
524 L" APN: %i%04i (%.0f%% efficiency)", interactive.tcp.u + 3038, interactive.tcp.v + 2038, opeff * 100.0f);
525 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
526
527
528 DrawTextW(L"1] Survey", 0, 45, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
529 DrawTextW(L"2] Inventory Management", 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
530 DrawTextW(L"3] Expansion", 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
531 DrawTextW(L"4] Demolition", 0, 90, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
532 DrawTextW(L"5] Manage Trade", 0, 105, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
533 DrawTextW(L"6] Cargo Operations", 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
534 if (interactive.tempplot.ATMcharge > -1)
535 swprintf_s(str, 99, L"7] Set ATM Fee (%i CR)", interactive.tempplot.ATMcharge);
536 else
537 wcscpy_s(str, 99, L" No ATM Installed");
538 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
539 DrawTextW(L"8] Diplomacy", 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
540
541 float sep = 0.0f;
542 if (interactive.tempplot.HasSeparatorResearch)
543 {
544 sep = (interactive.tempplot.oreA + interactive.tempplot.oreC + interactive.tempplot.oreD) / 255.0f;
545 if (sep > 1.0f)
546 sep = 1.0f / sep;
547 else
548 sep = 1.0f;
549 sep *= 110.0f;
550 }
551 float oblit = 0.0f;
552 if (interactive.tempplot.HasObliterator)
553 oblit = 240.0f;
554
555 // production and consumption totals
556 float extract = interactive.tempplot.DlyXtractHarvestProduce * opeff;
557 swprintf_s(str, 99,
558 L" Daily Extraction: %.3f MT (%.3f MT waiting)", extract, interactive.tempplot.rawOre);
559 DrawTextW(str, 0, 170, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
560
561 //float queued = interactive.tempplot.DlyXtractHarvestProduce * opeff + interactive.tempplot.rawOre;
562 //if (sep > queued) // 50 vs 25
563 // sep = queued;
564
565 // @note sep already accounts for the server "capmod" which is based on oreA+oreC+oreD>255
566 swprintf_s(str, 99,
567 L" Daily Separation: %.3f MT rare", sep * static_cast<float>(interactive.tempplot.oreA) / 255.0f * opeff * 0.3f);
568 DrawTextW(str, 0, 180, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
569 swprintf_s(str, 99,
570 L" %.3f MT common", sep * static_cast<float>(interactive.tempplot.oreC) / 255.0f * opeff * 1.3f);
571 DrawTextW(str, 0, 190, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
572 swprintf_s(str, 99,
573 L" %.3f MT fuel", sep * static_cast<float>(interactive.tempplot.oreD) / 255.0f * opeff);
574 DrawTextW(str, 0, 200, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
575 swprintf_s(str, 99,
576 L" Daily Obliteration: %.3f MT (%.3F MT tailings)", oblit * opeff, interactive.tempplot.waste);
577 DrawTextW(str, 0, 210, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
578
579 swprintf_s(str, 99,
580 L" Commodity Daily Consumption");
581 DrawTextW(str, 0, 225, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
582 swprintf_s(str, 99,
583 L" Rare %.3f MT", 0.0f);
584 DrawTextW(str, 0, 235, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
585 swprintf_s(str, 99,
586 L" Foodstuffs %.3f MT", interactive.tempplot.totalPopulation * 0.00109589f);
587 DrawTextW(str, 0, 245, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
588 swprintf_s(str, 99,
589 L" Common %.3f MT", 0.0f);
590 DrawTextW(str, 0, 255, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
591 swprintf_s(str, 99,
592 L" Fuel Ore %.3f MT", 0.0f);
593 DrawTextW(str, 0, 265, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
594 swprintf_s(str, 99,
595 L" Goods %.3f MT", interactive.tempplot.totalPopulation * 0.0f);
596 DrawTextW(str, 0, 275, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
597 swprintf_s(str, 99,
598 L" Materials %.3f MT", 0.0f);
599 DrawTextW(str, 0, 285, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
600 swprintf_s(str, 99,
601 L" Fuel %.3f MT", interactive.tempplot.totalPopulation * 0.000011785f + extract * 0.000247384f);
602 DrawTextW(str, 0, 295, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
603
604
605
606 // important messages
607 short x = 210, y = 45;
608 if (interactive.tempplot.totalPopulation >= 1.0f)
609 {
610 if (interactive.tempplot.procstorfood == 0.0f)
611 {
612 DrawTextW(L"** We desperately need food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
613 y += 15;
614 }
615 else
616 {
617 if ((interactive.tempplot.totalPopulation * 0.00109589f * 7.0f) > interactive.tempplot.procstorfood)
618 {
619 DrawTextW(L"++ We have less than a week's supply of food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
620 y += 15;
621 }
622 }
623 }
624 if (interactive.tempplot.colonyUplink == 0)
625 {
626 DrawTextW(L"++ The colony up-link has failed!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
627 y += 15;
628 }
629 if (interactive.tempplot.totalPopulation >= 1.0f && (interactive.tempplot.procstorA + interactive.tempplot.procstorfood + interactive.tempplot.procstorC + interactive.tempplot.procstorfuelore + interactive.tempplot.procstorgoods + interactive.tempplot.procstormaterials + interactive.tempplot.procstorfuel) >= interactive.tempplot.maxprocstor)
630 {
631 DrawTextW(L"++ Production halted, out of secure processed storage!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
632 y += 15;
633 }
634 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorfuel <= 0)
635 {
636 DrawTextW(L"++ Production halted, out of refined Iagreous fuel!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
637 y += 15;
638 }
639 if (floorf(interactive.tempplot.totalPopulation) > interactive.tempplot.maxcolstor)
640 {
641 DrawTextW(L"++ The colony is overpopulated!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
642 y += 15;
643 }
644 if (interactive.tempplot.colonistsbuilding > 0)
645 {
646 swprintf_s(str, 99, L".. We have %i people reassigned for construction", interactive.tempplot.colonistsbuilding);
647 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
648 y += 15;
649 }
650 if (interactive.tempplot.workingPopulation < interactive.mincoltorun)
651 {
652 swprintf_s(str, 99, L".. We are understaffed by %i workers", static_cast<short>(interactive.mincoltorun) - interactive.tempplot.workingPopulation);
653 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
654 y += 15;
655 }
656 if (y == 45)
657 {
658 DrawTextW(L".. No new messages!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
659 }
660 }
661 else if (interactive.menutype == 7) // farmstead
662 {
663 if (interactive.tempplot.colonyName[0] == 0)
664 {
665 if (interactive.tempplot.boundaryName[0] == 0)
666 swprintf_s(str, 99, L" Welcome! (population %.0f)", floorf(interactive.tempplot.totalPopulation));
667 else
668 swprintf_s(str, 99, L" Welcome to %S! (population %.0f)", interactive.tempplot.boundaryName, floorf(interactive.tempplot.totalPopulation));
669 }
670 else
671 {
672 if (interactive.tempplot.boundaryName[0] == 0)
673 swprintf_s(str, 99, L" Welcome to %S (population %.0f)", interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
674 else
675 swprintf_s(str, 99, L" Welcome to %S %S (population %.0f)", interactive.tempplot.boundaryName, interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
676 }
677 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
678
679 float opeff;
680 if (interactive.tempplot.workingPopulation >= 1.0f && interactive.mincoltorun > 0.0f)
681 {
682 opeff = (interactive.tempplot.workingPopulation - (float)interactive.tempplot.colonistsbuilding) / interactive.mincoltorun;
683 if (opeff > 1.0f)
684 opeff = 1.0f;
685 else if (opeff < 0.0f)
686 opeff = 0.0f;
687 opeff *= 0.5f + (float)interactive.type7built / 4.0f; // half as efficient to 1.5 times as efficient
688 }
689 else
690 opeff = 0.0f;
691
692 swprintf_s(str, 99,
693 L" APN: %i%04i (%.0f%% efficiency)", interactive.tcp.u + 3038, interactive.tcp.v + 2038, opeff * 100.0f);
694 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
695
696
697 DrawTextW(L"1] Survey", 0, 45, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
698 DrawTextW(L"2] Inventory Management", 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
699 DrawTextW(L"3] Expansion", 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
700 DrawTextW(L"4] Demolition", 0, 90, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
701 DrawTextW(L"5] Manage Trade", 0, 105, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
702 DrawTextW(L"6] Cargo Operations", 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
703 if (interactive.tempplot.ATMcharge > -1)
704 swprintf_s(str, 99, L"7] Set ATM Fee (%i CR)", interactive.tempplot.ATMcharge);
705 else
706 wcscpy_s(str, 99, L" No ATM Installed");
707 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
708 DrawTextW(L"8] Diplomacy", 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
709
710 long offset = ((long)interactive.tcp.v + 2037) * 2579L;
711 long newseason = (interactive.tempplot.ltime + offset) / 8116848L; // quarter-year number
712 long lastharvest = (interactive.tempplot.ltime + offset) % 8116848L; // seconds since last harvest
713 long nextharvestsec = 8116848L - lastharvest;
714 long seasontype = newseason % 4;
715 char seasontext[9];
716 if (seasontype == 0)
717 sprintf_s(seasontext, sizeof(seasontext), "Spring");
718 else if (seasontype == 1)
719 sprintf_s(seasontext, sizeof(seasontext), "Summer");
720 else if (seasontype == 2)
721 sprintf_s(seasontext, sizeof(seasontext), "Fall");
722 else
723 sprintf_s(seasontext, sizeof(seasontext), "Winter");
724
725
726
727 float dayspassed = (float)lastharvest / 86400.0f; // days passed already
728
729 // production and consumption totals
730 swprintf_s(str, 99,
731 L" Current season: %S", seasontext);
732 DrawTextW(str, 0, 165, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
733 swprintf_s(str, 99,
734 L" Season ends: %.0f day(s)", (93.945f - dayspassed) * 1.663202f); // vieneo days
735 DrawTextW(str, 0, 175, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
736
737 // take current storage and number of days
738 // add current production and nextharvest
739 //float seasonavg = 0.0f;
740 //if (dayspassed > 0.0f)
741 // seasonavg = interactive.tempplot.rawFood; // we moved this to territory level so it is not apples to apples anymore
742 // 8 and 10 days that is 8 MT so far
743 float fieldcrops = 0.0f;
744 if ((seasontype == 0 && interactive.tcp.v > -115 && interactive.tcp.v < 2154) ||
745 (seasontype == 1 && interactive.tcp.v > -439 && interactive.tcp.v < 2478) ||
746 (seasontype == 2 && interactive.tcp.v > 268 && interactive.tcp.v < 1771) ||
747 (seasontype == 3 && interactive.tcp.v > 559 && interactive.tcp.v < 1480))
748 fieldcrops = (float)interactive.type2built * 0.6716f * powf(1.0f - interactive.tempplot.grade / 100.0f, 2.0f);
749 float greenhouses = (float)interactive.type3built * 4.7012f; // per harvest
750 float hydroponics = (float)interactive.type4built * 14.1036f; // per harvest
751 float grow = (greenhouses + hydroponics + fieldcrops);
752 // so all we have is field crops
753 // 93.945-10 is 83.945 days/93.945 is .89 of season left *(8 crops at .6716 is 5.3728) is 4.78
754 // so 8MT plus 4.78MT is 12.78 MT for the season
755 //float magnitude = 0.0f;
756 //if (grow > 0.0f)
757 // magnitude = seasonavg / grow;
758
759 swprintf_s(str, 99,
760 L" Harvest estimates: %.3f MT food (total)", grow);
761 DrawTextW(str, 0, 185, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
762 swprintf_s(str, 99,
763 L" %.3f MT food (hydroponics)", hydroponics);
764 DrawTextW(str, 0, 195, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
765 swprintf_s(str, 99,
766 L" %.3f MT food (greenhouses)", greenhouses);
767 DrawTextW(str, 0, 205, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
768 swprintf_s(str, 99,
769 L" %.3f MT food (algae farms)", fieldcrops);
770 DrawTextW(str, 0, 215, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
771
772
773 swprintf_s(str, 99,
774 L" Commodity Daily Consumption");
775 DrawTextW(str, 0, 230, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
776 swprintf_s(str, 99,
777 L" Rare %.3f MT", 0.0f);
778 DrawTextW(str, 0, 240, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
779 swprintf_s(str, 99,
780 L" Foodstuffs %.3f MT", interactive.tempplot.totalPopulation * 0.00109589f);
781 DrawTextW(str, 0, 250, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
782 swprintf_s(str, 99,
783 L" Common %.3f MT", 0.0f);
784 DrawTextW(str, 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
785 swprintf_s(str, 99,
786 L" Fuel Ore %.3f MT", 0.0f);
787 DrawTextW(str, 0, 270, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
788 swprintf_s(str, 99,
789 L" Goods %.3f MT", interactive.tempplot.totalPopulation * 0.0f);
790 DrawTextW(str, 0, 280, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
791 swprintf_s(str, 99,
792 L" Materials %.3f MT", 0.0f);
793 DrawTextW(str, 0, 290, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
794 swprintf_s(str, 99,
795 L" Fuel %.3f MT", interactive.tempplot.totalPopulation * 0.000011785f + grow * 0.0000002035f);
796 DrawTextW(str, 0, 300, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
797
798
799 // important messages
800 short x = 210, y = 45;
801 if (interactive.tempplot.totalPopulation >= 1.0f)
802 {
803 if (interactive.tempplot.procstorfood == 0.0f)
804 {
805 DrawTextW(L"** We desperately need food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
806 y += 15;
807 }
808 else
809 {
810 if ((interactive.tempplot.totalPopulation * 0.00109589f * 7.0f) > interactive.tempplot.procstorfood)
811 {
812 DrawTextW(L"++ We have less than a week's supply of food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
813 y += 15;
814 }
815 }
816 }
817 if (interactive.tempplot.colonyUplink == 0)
818 {
819 DrawTextW(L"++ The colony up-link has failed!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
820 y += 15;
821 }
822 if ((interactive.tempplot.ltime - interactive.tempplot.incept + nextharvestsec) < 5256000L)
823 {
824 DrawTextW(L"++ This farm will miss this first harvest!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
825 y += 15;
826 }
827 else if (interactive.tempplot.totalPopulation >= 1.0f && (interactive.tempplot.procstorA + interactive.tempplot.procstorfood + interactive.tempplot.procstorC + interactive.tempplot.procstorfuelore + interactive.tempplot.procstorgoods + interactive.tempplot.procstormaterials + interactive.tempplot.procstorfuel) >= interactive.tempplot.maxprocstor)
828 {
829 DrawTextW(L"++ No space for the upcoming harvest!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
830 y += 15;
831 }
832 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorfuel <= 0)
833 {
834 DrawTextW(L"++ Production halted, out of refined Iagreous fuel!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
835 y += 15;
836 }
837 if (floorf(interactive.tempplot.totalPopulation) > interactive.tempplot.maxcolstor)
838 {
839 DrawTextW(L"++ The colony is overpopulated!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
840 y += 15;
841 }
842 if (interactive.tempplot.colonistsbuilding > 0)
843 {
844 swprintf_s(str, 99, L".. We have %i people reassigned for construction", interactive.tempplot.colonistsbuilding);
845 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
846 y += 15;
847 }
848 if (interactive.tempplot.workingPopulation < interactive.mincoltorun)
849 {
850 swprintf_s(str, 99, L".. We are understaffed by %i workers", static_cast<short>(interactive.mincoltorun) - interactive.tempplot.workingPopulation);
851 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
852 y += 15;
853 }
854 if (!((seasontype == 0 && interactive.tcp.v > -115 && interactive.tcp.v < 2154) ||
855 (seasontype == 1 && interactive.tcp.v > -439 && interactive.tcp.v < 2478) ||
856 (seasontype == 2 && interactive.tcp.v > 268 && interactive.tcp.v < 1771) ||
857 (seasontype == 3 && interactive.tcp.v > 559 && interactive.tcp.v < 1480)))
858 {
859 DrawTextW(L".. Algae farms are currently out of season", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
860 y += 15;
861 }
862
863 if (y == 45)
864 {
865 DrawTextW(L".. No new messages!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
866 }
867 }
868 else if (interactive.menutype == 8) // dock trade
869 {
870 char buy[15], sell[15];
871 DrawTextW(L" Commodity Type Inventory Units Buying Selling", 0, 30, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
872
873 if (interactive.tempdock.buyA == 0)
874 sprintf_s(buy, sizeof(buy), "No");
875 else
876 sprintf_s(buy, sizeof(buy), "%i CR/MT", interactive.tempdock.buyA);
877 if (interactive.tempdock.sellA == 0)
878 sprintf_s(sell, sizeof(sell), "No");
879 else
880 sprintf_s(sell, sizeof(sell), "%i CR/MT", interactive.tempdock.sellA);
881 swprintf_s(str, 99, L"1] Rare/Precious %-9.0f MT %-12S %-12S", floorf(interactive.tempdock.procstorA), buy, sell);
882 DrawTextW(str, 0, 70, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
883
884 if (interactive.tempdock.buyB == 0)
885 sprintf_s(buy, sizeof(buy), "No");
886 else
887 sprintf_s(buy, sizeof(buy), "%i CR/MT", interactive.tempdock.buyB);
888 if (interactive.tempdock.sellB == 0)
889 sprintf_s(sell, sizeof(sell), "No");
890 else
891 sprintf_s(sell, sizeof(sell), "%i CR/MT", interactive.tempdock.sellB);
892 swprintf_s(str, 99, L"2] Foodstuffs %-9.0f MT %-12S %-12S", floorf(interactive.tempdock.procstorfood), buy, sell);
893 DrawTextW(str, 0, 95, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
894
895 if (interactive.tempdock.buyC == 0)
896 sprintf_s(buy, sizeof(buy), "No");
897 else
898 sprintf_s(buy, sizeof(buy), "%i CR/MT", interactive.tempdock.buyC);
899 if (interactive.tempdock.sellC == 0)
900 sprintf_s(sell, sizeof(sell), "No");
901 else
902 sprintf_s(sell, sizeof(sell), "%i CR/MT", interactive.tempdock.sellC);
903 swprintf_s(str, 99, L"3] Common Materials %-9.0f MT %-12S %-12S", floorf(interactive.tempdock.procstorC), buy, sell);
904 DrawTextW(str, 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
905
906 if (interactive.tempdock.buyD == 0)
907 sprintf_s(buy, sizeof(buy), "No");
908 else
909 sprintf_s(buy, sizeof(buy), "%i CR/MT", interactive.tempdock.buyD);
910 if (interactive.tempdock.sellD == 0)
911 sprintf_s(sell, sizeof(sell), "No");
912 else
913 sprintf_s(sell, sizeof(sell), "%i CR/MT", interactive.tempdock.sellD);
914 swprintf_s(str, 99, L"4] Fuel Ore %-9.0f MT %-12S %-12S", floorf(interactive.tempdock.procstorfuelore), buy, sell);
915 DrawTextW(str, 0, 145, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
916
917 if (interactive.tempdock.buyE == 0)
918 sprintf_s(buy, sizeof(buy), "No");
919 else
920 sprintf_s(buy, sizeof(buy), "%i CR/MT", interactive.tempdock.buyE);
921 if (interactive.tempdock.sellE == 0)
922 sprintf_s(sell, sizeof(sell), "No");
923 else
924 sprintf_s(sell, sizeof(sell), "%i CR/MT", interactive.tempdock.sellE);
925 swprintf_s(str, 99, L"5] Consumer Goods %-9.0f MT %-12S %-12S", floorf(interactive.tempdock.procstorgoods), buy, sell);
926 DrawTextW(str, 0, 170, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
927
928 if (interactive.tempdock.buyF == 0)
929 sprintf_s(buy, sizeof(buy), "No");
930 else
931 sprintf_s(buy, sizeof(buy), "%i CR/MT", interactive.tempdock.buyF);
932 if (interactive.tempdock.sellF == 0)
933 sprintf_s(sell, sizeof(sell), "No");
934 else
935 sprintf_s(sell, sizeof(sell), "%i CR/MT", interactive.tempdock.sellF);
936 swprintf_s(str, 99, L"6] Fabricated Materials %-9.0f MT %-12S %-12S", floorf(interactive.tempdock.procstormaterials), buy, sell);
937 DrawTextW(str, 0, 195, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
938
939 if (interactive.tempdock.buyG == 0)
940 sprintf_s(buy, sizeof(buy), "No");
941 else
942 sprintf_s(buy, sizeof(buy), "%i CR/MT", interactive.tempdock.buyG);
943 if (interactive.tempdock.sellG == 0)
944 sprintf_s(sell, sizeof(sell), "No");
945 else
946 sprintf_s(sell, sizeof(sell), "%i CR/MT", interactive.tempdock.sellG);
947 swprintf_s(str, 99, L"7] Iagreous Fuel %-9.0f MT %-12S %-12S", floorf(interactive.tempdock.procstorfuel), buy, sell);
948 DrawTextW(str, 0, 220, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
949 }
950 else if (interactive.menutype == 9 || interactive.menutype == 12) // township expansion/demolition
951 {
952 float gradeadj = 1.0f + powf(interactive.tempplot.grade * 0.01f, 2.0f) * 63.0f;
953 if (interactive.menutype == 12)
954 gradeadj *= 0.2625f;
955 if (interactive.tempplot.constructime == 0L)
956 {
957 if (interactive.menutype == 9)
958 {
959 swprintf_s(str, 99,
960 L" Availability for construction %7i MT common %i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
961 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
962 swprintf_s(str, 99,
963 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
964 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
965 }
966 else
967 {
968 swprintf_s(str, 99,
969 L" Availability for demolition %7i MT common %i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
970 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
971 swprintf_s(str, 99,
972 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
973 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
974 }
975
976 }
977 else
978 {
979 char timerem[99];
980 if (interactive.tempplot.constructime > 103896L)
981 sprintf_s(timerem, sizeof(timerem), "%5i days left ", interactive.tempplot.constructime / 51948L); // vieneo days
982 else if (interactive.tempplot.constructime > 3600L)
983 sprintf_s(timerem, sizeof(timerem), "%5i hours left ", interactive.tempplot.constructime / 3600L);
984 else if (interactive.tempplot.constructime > 60L)
985 sprintf_s(timerem, sizeof(timerem), "%5i minutes left", interactive.tempplot.constructime / 60L);
986 else
987 sprintf_s(timerem, sizeof(timerem), "One minute left!");
988
989 swprintf_s(str, 99,
990 L" CONSTRUCTION IN PROGRESS %S (%i colonists building)", timerem, interactive.tempplot.colonistsbuilding);
991 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
992 }
993
994 if (interactive.menutype == 9)
995 {
996 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Needed Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
997 }
998 else
999 {
1000 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Recycled Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1001 }
1002 swprintf_s(str, 99,
1003 L"1] Town Hall %-4i 1 96 colonists %5.0f MT common 13 labor", interactive.type1built, ceilf(387.0f * gradeadj));
1004 DrawTextW(str, 0, 50, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1005 swprintf_s(str, 99,
1006 L" %5.0f MT fabricated", ceilf(284.0f * gradeadj));
1007 DrawTextW(str, 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1008
1009 swprintf_s(str, 99,
1010 L"2] Residences %-4i 4 932 colonists %5.0f MT common 2 labor", interactive.type2built, ceilf(301.0f * gradeadj));
1011 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1012 swprintf_s(str, 99,
1013 L" %5.0f MT fabricated", ceilf(220.0f * gradeadj));
1014 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1015
1016 swprintf_s(str, 99,
1017 L"3] Industry %-4i 3 Refinement/ %5.0f MT common 16 labor", interactive.type3built, ceilf(490.0f * gradeadj));
1018 DrawTextW(str, 0, 100, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1019 swprintf_s(str, 99,
1020 L" Manufacturing %5.0f MT fabricated", ceilf(359.0f * gradeadj));
1021 DrawTextW(str, 0, 110, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1022
1023 swprintf_s(str, 99,
1024 L"4] Research Lab %-4i 1 Technologies/ %5.0f MT common 9 labor", interactive.type4built, ceilf(410.0f * gradeadj));
1025 DrawTextW(str, 0, 125, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1026 swprintf_s(str, 99,
1027 L" Products %5.0f MT fabricated", ceilf(301.0f * gradeadj));
1028 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1029
1030 swprintf_s(str, 99,
1031 L"5] Recreation %-4i 3 Casinos %5.0f MT common 3 labor", interactive.type5built, ceilf(240.0f * gradeadj));
1032 DrawTextW(str, 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1033 swprintf_s(str, 99,
1034 L" Parks/Shopping %5.0f MT fabricated", ceilf(176.0f * gradeadj));
1035 DrawTextW(str, 0, 160, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1036
1037 swprintf_s(str, 99,
1038 L"6] Material Storage %-4i 1 20479 MT storage %5.0f MT common 8 labor", interactive.type6built, ceilf(649.0f * gradeadj));
1039 DrawTextW(str, 0, 175, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1040 swprintf_s(str, 99,
1041 L" %5.0f MT fabricated", 0.0f);
1042 DrawTextW(str, 0, 185, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1043
1044 swprintf_s(str, 99,
1045 L"7] Support Structures %-4i 5 Government %5.0f MT common 12 labor", interactive.type7built, ceilf(132.0f * gradeadj));
1046 DrawTextW(str, 0, 200, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1047 swprintf_s(str, 99,
1048 L" %5.0f MT fabricated", ceilf(99.0f * gradeadj));
1049 DrawTextW(str, 0, 210, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1050
1051 swprintf_s(str, 99,
1052 L"8] Power Production %-4i 1 848 GJ daily %5.0f MT common 4 labor", interactive.type8built, ceilf(132.0f * gradeadj));
1053 DrawTextW(str, 0, 225, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1054 swprintf_s(str, 99,
1055 L" 7 MT fuel/day %5.0f MT fabricated", ceilf(99.0f * gradeadj));
1056 DrawTextW(str, 0, 235, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1057
1058 swprintf_s(str, 99,
1059 L"9] Defensive Platforms %-4i 1 4 GJ/burst %5.0f MT common 6 labor", interactive.type9built, ceilf(132.0f * gradeadj));
1060 DrawTextW(str, 0, 250, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1061 swprintf_s(str, 99,
1062 L" 1 colonist %5.0f MT fabricated", ceilf(99.0f * gradeadj));
1063 DrawTextW(str, 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1064 }
1065 else if (interactive.menutype == 10) // town hall
1066 {
1067 if (interactive.tempplot.colonyName[0] == 0)
1068 {
1069 if (interactive.tempplot.boundaryName[0] == 0)
1070 swprintf_s(str, 99, L" Welcome! (population %.0f)", floorf(interactive.tempplot.totalPopulation));
1071 else
1072 swprintf_s(str, 99, L" Welcome to %S! (population %.0f)", interactive.tempplot.boundaryName, floorf(interactive.tempplot.totalPopulation));
1073 }
1074 else
1075 {
1076 if (interactive.tempplot.boundaryName[0] == 0)
1077 swprintf_s(str, 99, L" Welcome to %S (population %.0f)", interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
1078 else
1079 swprintf_s(str, 99, L" Welcome to %S %S (population %.0f)", interactive.tempplot.boundaryName, interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
1080 }
1081 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1082
1083 float opeff;
1084 if (interactive.tempplot.workingPopulation >= 1.0f && interactive.mincoltorun > 0.0f)
1085 {
1086 opeff = (interactive.tempplot.workingPopulation * 0.75f - (float)interactive.tempplot.colonistsbuilding) / interactive.mincoltorun;
1087 if (opeff > 1.0f)
1088 opeff = 1.0f;
1089 else if (opeff < 0.0f)
1090 opeff = 0.0f;
1091 opeff *= 0.5f + (float)interactive.type7built / 5.0f; // half as efficient to 1.5 times as efficient
1092 }
1093 else
1094 opeff = 0.0f;
1095
1096 swprintf_s(str, 99,
1097 L" APN: %i%04i (%.0f%% efficiency)", interactive.tcp.u + 3038, interactive.tcp.v + 2038, opeff * 100.0f);
1098 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1099
1100
1101 DrawTextW(L"1] Survey", 0, 45, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1102 DrawTextW(L"2] Inventory Management", 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1103 DrawTextW(L"3] Expansion", 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1104 DrawTextW(L"4] Demolition", 0, 90, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1105 DrawTextW(L"5] Manage Trade", 0, 105, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1106 DrawTextW(L"6] Cargo Operations", 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1107 if (interactive.tempplot.ATMcharge > -1)
1108 swprintf_s(str, 99, L"7] Set ATM Fee (%i CR)", interactive.tempplot.ATMcharge);
1109 else
1110 wcscpy_s(str, 99, L" No ATM Installed");
1111 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1112 DrawTextW(L"8] Diplomacy", 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1113
1114 float matprod = 0.0f, natused = 0.0f, fuelprod = 0.0f, fueloreused = 0.0f, rarused = 0.0f, goodprod = 0.0f, matused = 0.0f, foodused = 0.0f, fuelused = 0.0f;
1115 if (interactive.tempplot.procstorA > interactive.tempplot.minA &&
1116 interactive.tempplot.procstorC > interactive.tempplot.minC &&
1117 interactive.tempplot.procstormaterials < interactive.tempplot.maxF)
1118 {
1119 float staff = interactive.tempplot.workingPopulation * (float)interactive.tempplot.makeF * 0.01f * 0.25f;
1120 staff *= interactive.tempplot.DlyXtractHarvestProduce;
1121 // used to be 80 MT per 100 but based on global pricing over last 14 years of data we are adjusting this to 50 as of 10/8/2020
1122 matprod = staff / 100.0f * 50.0f * opeff; // 25 per 100 people per day
1123 natused += staff / 100.0f * 50.0f * opeff / 0.98f; // 2% wasted
1124 rarused += staff / 100.0f * 50.0f * opeff / 0.98f * 0.060212377f;
1125 fuelused += matprod * 0.011538462f;
1126 }
1127
1128 if (interactive.tempplot.procstorfuelore > interactive.tempplot.minD && interactive.tempplot.procstorfuel < interactive.tempplot.maxG)
1129 {
1130 float staff = interactive.tempplot.workingPopulation * (float)interactive.tempplot.makeG * 0.01f * 0.25f;
1131 staff *= interactive.tempplot.DlyXtractHarvestProduce;
1132 // used to be 4.08 MT per 140 but based on global pricing over last 14 years of data we are doubling it as of 10/8/2020
1133 fuelprod = staff / 100.0f * 6.0f * opeff;
1134 fueloreused += fuelprod / 0.4642857143f; // 42 gal becomes 19.5 gal
1135 fuelused += fuelprod * 0.0029312f;
1136 }
1137
1138 if (interactive.tempplot.procstorfood > interactive.tempplot.minB &&
1139 interactive.tempplot.procstormaterials > interactive.tempplot.minF &&
1140 interactive.tempplot.procstorgoods < interactive.tempplot.maxE)
1141 {
1142 float staff = interactive.tempplot.workingPopulation * (float)interactive.tempplot.makeE * 0.01f * 0.25f;
1143 staff *= interactive.tempplot.DlyXtractHarvestProduce;
1144 goodprod = staff / 100.0f * 2.5f * opeff; // 2.5 per 100 people per day
1145 foodused += goodprod * 0.1f * 1.1f;
1146 matused += goodprod * 0.9f * 1.1f;
1147 fuelused += goodprod * 0.25f;
1148 }
1149
1150 // production and consumption totals
1151 swprintf_s(str, 99,
1152 L" Daily Production: %.3f MT refined fuel", fuelprod);
1153 DrawTextW(str, 0, 170, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1154 swprintf_s(str, 99,
1155 L" %.3f MT materials", matprod);
1156 DrawTextW(str, 0, 180, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1157 swprintf_s(str, 99,
1158 L" %.3f MT goods", goodprod);
1159 DrawTextW(str, 0, 190, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1160
1161 swprintf_s(str, 99,
1162 L" Commodity Daily Consumption");
1163 DrawTextW(str, 0, 205, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1164 swprintf_s(str, 99,
1165 L" Rare %.3f MT", rarused);
1166 DrawTextW(str, 0, 215, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1167 swprintf_s(str, 99,
1168 L" Foodstuffs %.3f MT", interactive.tempplot.totalPopulation * 0.00109589f + foodused);
1169 DrawTextW(str, 0, 225, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1170 swprintf_s(str, 99,
1171 L" Common %.3f MT", natused);
1172 DrawTextW(str, 0, 235, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1173 swprintf_s(str, 99,
1174 L" Fuel Ore %.3f MT", fueloreused);
1175 DrawTextW(str, 0, 245, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1176 swprintf_s(str, 99,
1177 L" Goods %.3f MT", interactive.tempplot.totalPopulation * 0.00094486628821917808219178082191781f);
1178 DrawTextW(str, 0, 255, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1179 swprintf_s(str, 99,
1180 L" Materials %.3f MT", matused);
1181 DrawTextW(str, 0, 265, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1182 swprintf_s(str, 99,
1183 L" Fuel %.3f MT", interactive.tempplot.totalPopulation * 0.000011785f + fuelused);
1184 DrawTextW(str, 0, 275, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1185
1186
1187 // important messages
1188 short x = 210, y = 45;
1189 if (interactive.tempplot.totalPopulation >= 1.0f)
1190 {
1191 if (interactive.tempplot.procstorfood == 0.0f)
1192 {
1193 DrawTextW(L"** We desperately need food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1194 y += 15;
1195 }
1196 else
1197 {
1198 if ((interactive.tempplot.totalPopulation * 0.00109589f * 7.0f) > interactive.tempplot.procstorfood)
1199 {
1200 DrawTextW(L"++ We have less than a week's supply of food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1201 y += 15;
1202 }
1203 }
1204 }
1205 if (interactive.tempplot.colonyUplink == 0)
1206 {
1207 DrawTextW(L"++ The colony up-link has failed!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1208 y += 15;
1209 }
1210 if (interactive.tempplot.totalPopulation >= 1.0f && (interactive.tempplot.procstorA + interactive.tempplot.procstorfood + interactive.tempplot.procstorC + interactive.tempplot.procstorfuelore + interactive.tempplot.procstorgoods + interactive.tempplot.procstormaterials + interactive.tempplot.procstorfuel) >= interactive.tempplot.maxprocstor)
1211 {
1212 DrawTextW(L"++ Production halted, out of secure processed storage!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1213 y += 15;
1214 }
1215 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorfuel <= 0)
1216 {
1217 DrawTextW(L"++ Production halted, out of refined Iagreous fuel!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1218 y += 15;
1219 }
1220 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorA <= interactive.tempplot.minA)
1221 {
1222 DrawTextW(L"++ Fabricated production halted,", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1223 y += 15;
1224 DrawTextW(L"++ into reserves of rare material!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1225 y += 15;
1226 }
1227 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorC <= interactive.tempplot.minC)
1228 {
1229 DrawTextW(L"++ Fabricated production halted,", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1230 y += 15;
1231 DrawTextW(L"++ into reserves of common material!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1232 y += 15;
1233 }
1234 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstormaterials >= interactive.tempplot.maxF)
1235 {
1236 DrawTextW(L"++ Fabricated production halted,", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1237 y += 15;
1238 DrawTextW(L"++ surplus of fabricated materials!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1239 y += 15;
1240 }
1241 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorfuelore <= interactive.tempplot.minD)
1242 {
1243 DrawTextW(L"++ Fuel refining halted,", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1244 y += 15;
1245 DrawTextW(L"++ into reserves of unrefined fuel ore!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1246 y += 15;
1247 }
1248 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorfuel >= interactive.tempplot.maxG)
1249 {
1250 DrawTextW(L"++ Fuel refining halted,", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1251 y += 15;
1252 DrawTextW(L"++ surplus of refined fuel!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1253 y += 15;
1254 }
1255
1256 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorfood <= interactive.tempplot.minB)
1257 {
1258 DrawTextW(L"++ Consumer goods production halted,", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1259 y += 15;
1260 DrawTextW(L"++ into reserves of foodstuffs!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1261 y += 15;
1262 }
1263 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstormaterials <= interactive.tempplot.minF)
1264 {
1265 DrawTextW(L"++ Consumer goods production halted,", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1266 y += 15;
1267 DrawTextW(L"++ into reserves of fabricated material!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1268 y += 15;
1269 }
1270 if (interactive.tempplot.totalPopulation >= 1.0f && interactive.tempplot.procstorgoods >= interactive.tempplot.maxE)
1271 {
1272 DrawTextW(L"++ Consumer goods production halted,", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1273 y += 15;
1274 DrawTextW(L"++ surplus of consumer goods!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1275 y += 15;
1276 }
1277
1278 if (floorf(interactive.tempplot.totalPopulation) > interactive.tempplot.maxcolstor)
1279 {
1280 DrawTextW(L"++ The colony is overpopulated!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1281 y += 15;
1282 }
1283 if (interactive.tempplot.colonistsbuilding > 0)
1284 {
1285 swprintf_s(str, 99, L".. We have %i people reassigned for construction", interactive.tempplot.colonistsbuilding);
1286 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1287 y += 15;
1288 }
1289 if (interactive.tempplot.workingPopulation < interactive.mincoltorun)
1290 {
1291 swprintf_s(str, 99, L".. We are understaffed by %i workers", static_cast<short>(interactive.mincoltorun) - interactive.tempplot.workingPopulation);
1292 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1293 y += 15;
1294 }
1295 if (y == 45)
1296 {
1297 DrawTextW(L".. No new messages!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1298 }
1299 }
1300 else if (interactive.menutype == 11) // commodity trade
1301 {
1302 DrawTextW(L" Commodity Type Options Held We Paid Trading At", 0, 30, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1303
1304 swprintf_s(str, 99, L"1] Rare/Precious %-9.0f MT %-5i CR %-5i CR", floorf(interactive.tempdock.procstorA), interactive.tempdock.sellA, interactive.tempdock.buyA);
1305 DrawTextW(str, 0, 70, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1306
1307 swprintf_s(str, 99, L"2] Foodstuffs %-9.0f MT %-5i CR %-5i CR", floorf(interactive.tempdock.procstorfood), interactive.tempdock.sellB, interactive.tempdock.buyB);
1308 DrawTextW(str, 0, 95, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1309
1310 swprintf_s(str, 99, L"3] Common Materials %-9.0f MT %-5i CR %-5i CR", floorf(interactive.tempdock.procstorC), interactive.tempdock.sellC, interactive.tempdock.buyC);
1311 DrawTextW(str, 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1312
1313 swprintf_s(str, 99, L"4] Fuel Ore %-9.0f MT %-5i CR %-5i CR", floorf(interactive.tempdock.procstorfuelore), interactive.tempdock.sellD, interactive.tempdock.buyD);
1314 DrawTextW(str, 0, 145, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1315
1316 swprintf_s(str, 99, L"5] Consumer Goods %-9.0f MT %-5i CR %-5i CR", floorf(interactive.tempdock.procstorgoods), interactive.tempdock.sellE, interactive.tempdock.buyE);
1317 DrawTextW(str, 0, 170, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1318
1319 swprintf_s(str, 99, L"6] Fabricated Materials %-9.0f MT %-5i CR %-5i CR", floorf(interactive.tempdock.procstormaterials), interactive.tempdock.sellF, interactive.tempdock.buyF);
1320 DrawTextW(str, 0, 195, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1321
1322 swprintf_s(str, 99, L"7] Iagreous Fuel %-9.0f MT %-5i CR %-5i CR", floorf(interactive.tempdock.procstorfuel), interactive.tempdock.sellG, interactive.tempdock.buyG);
1323 DrawTextW(str, 0, 220, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1324
1325
1326 if (interactive.tempdock.lastannouncement > 34081)
1327 {
1328 DrawTextW(L" Trading volume today: Record-breaking!", 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1329 }
1330 else if (interactive.tempdock.lastannouncement > 27264)
1331 {
1332 DrawTextW(L" Trading volume today: Very heavy", 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1333 }
1334 else if (interactive.tempdock.lastannouncement > 20448)
1335 {
1336 DrawTextW(L" Trading volume today: Moderately heavy", 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1337 }
1338 else if (interactive.tempdock.lastannouncement > 13632)
1339 {
1340 DrawTextW(L" Trading volume today: Average", 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1341 }
1342 else if (interactive.tempdock.lastannouncement > 6816)
1343 {
1344 DrawTextW(L" Trading volume today: Moderately light", 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1345 }
1346 else if (interactive.tempdock.lastannouncement > 0)
1347 {
1348 DrawTextW(L" Trading volume today: Very light", 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1349 }
1350 else
1351 {
1352 DrawTextW(L" Trading volume today: None", 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1353 }
1354 }
1355 else if (interactive.menutype == 141) // FBO airfield
1356 {
1357 if (interactive.tempplot.colonyName[0] == 0)
1358 {
1359 if (interactive.tempplot.boundaryName[0] == 0)
1360 swprintf_s(str, 99, L" Welcome! (population %.0f)", floorf(interactive.tempplot.totalPopulation));
1361 else
1362 swprintf_s(str, 99, L" Welcome to %S! (population %.0f)", interactive.tempplot.boundaryName, floorf(interactive.tempplot.totalPopulation));
1363 }
1364 else
1365 {
1366 if (interactive.tempplot.boundaryName[0] == 0)
1367 swprintf_s(str, 99, L" Welcome to %S (population %.0f)", interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
1368 else
1369 swprintf_s(str, 99, L" Welcome to %S %S (population %.0f)", interactive.tempplot.boundaryName, interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
1370 }
1371 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1372
1373 float opeff;
1374 if (interactive.tempplot.workingPopulation >= 1.0f && interactive.mincoltorun > 0.0f)
1375 {
1376 opeff = (interactive.tempplot.workingPopulation * 0.75f - (float)interactive.tempplot.colonistsbuilding) / interactive.mincoltorun;
1377 if (opeff > 1.0f)
1378 opeff = 1.0f;
1379 else if (opeff < 0.0f)
1380 opeff = 0.0f;
1381 opeff *= 0.5f + (float)interactive.type7built / 5.0f; // half as efficient to 1.5 times as efficient
1382 }
1383 else
1384 opeff = 0.0f;
1385
1386 swprintf_s(str, 99,
1387 L" APN: %i%04i (%.0f%% efficiency)", interactive.tcp.u + 3038, interactive.tcp.v + 2038, opeff * 100.0f);
1388 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1389
1390
1391 DrawTextW(L"1] Survey", 0, 45, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1392 DrawTextW(L"2] Inventory Management", 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1393 DrawTextW(L"3] Expansion", 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1394 DrawTextW(L"4] Demolition", 0, 90, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1395 DrawTextW(L"5] Manage Trade", 0, 105, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1396 DrawTextW(L"6] Cargo Operations", 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1397 if (interactive.tempplot.ATMcharge > -1)
1398 swprintf_s(str, 99, L"7] Set ATM Fee (%i CR)", interactive.tempplot.ATMcharge);
1399 else
1400 wcscpy_s(str, 99, L" No ATM Installed");
1401 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1402 DrawTextW(L"8] Diplomacy", 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1403 DrawTextW(L"9] Colonist Migration", 0, 165, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1404
1405 // float matprod = 0.0f, fuelprod = 0.0f;
1406 float natused = 0.0f, fuelused = 0.0f, rarused = 0.0f;
1407 //if (interactive.tempplot.procstorC > interactive.tempplot.minC && interactive.tempplot.procstormaterials < interactive.tempplot.maxF) // minimum to keep on hand
1408 //{
1409 // float staff = interactive.tempplot.workingPopulation*(float)interactive.tempplot.makeF*0.01f*0.25f;
1410 // staff *= interactive.tempplot.DlyXtractC;
1411 // matprod += staff / 100.0f*80.0f*opeff; // 80 per 100 people per day
1412 // natused += staff / 100.0f*80.0f*opeff / 0.98f; // 2% wasted
1413 // rarused += staff / 100.0f*80.0f*opeff / 0.98f*0.060212377f;
1414 //}
1415
1416 //if (interactive.tempplot.procstorfuelore > interactive.tempplot.minD && interactive.tempplot.procstorfuel < interactive.tempplot.maxG)
1417 //{
1418 // float staff = interactive.tempplot.workingPopulation*(float)interactive.tempplot.makeG*0.01f*0.25f;
1419 // staff *= interactive.tempplot.DlyXtractC;
1420 // fuelprod += staff / 140.0f*4.08f*opeff; // takes 140 people to produce 4.08 MT of fuel ore
1421 // fuelused += staff / 140.0f*4.08f*opeff / 0.4642857143f; // 42 gal becomes 19.5 gal
1422 //}
1423
1424 // production and consumption totals
1425 /*swprintf_s(str, 99,
1426 L" Daily Production: %.3f MT refined fuel", fuelprod);
1427 DrawTextW(str, 0, 170, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1428 swprintf_s(str, 99,
1429 L" %.3f MT materials", matprod);
1430 DrawTextW(str, 0, 180, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1431 swprintf_s(str, 99,
1432 L" %.3f MT goods", 0.0f);
1433 DrawTextW(str, 0, 190, 0.1f, DT_NOCLIP, 0xFFA0A0A0);*/
1434
1435 swprintf_s(str, 99,
1436 L" Commodity Daily Consumption");
1437 DrawTextW(str, 0, 205, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1438 swprintf_s(str, 99,
1439 L" Rare %.3f MT", rarused);
1440 DrawTextW(str, 0, 215, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1441 swprintf_s(str, 99,
1442 L" Foodstuffs %.3f MT", interactive.tempplot.totalPopulation * 0.00109589f);
1443 DrawTextW(str, 0, 225, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1444 swprintf_s(str, 99,
1445 L" Common %.3f MT", natused);
1446 DrawTextW(str, 0, 235, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1447 swprintf_s(str, 99,
1448 L" Fuel Ore %.3f MT", fuelused);
1449 DrawTextW(str, 0, 245, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1450 swprintf_s(str, 99,
1451 L" Goods %.3f MT", 0.0f);
1452 DrawTextW(str, 0, 255, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1453 swprintf_s(str, 99,
1454 L" Materials %.3f MT", 0.0f);
1455 DrawTextW(str, 0, 265, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1456 swprintf_s(str, 99,
1457 L" Fuel %.3f MT", interactive.tempplot.totalPopulation * 0.000011785f);
1458 DrawTextW(str, 0, 275, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1459
1460
1461 // important messages
1462 short x = 210, y = 45;
1463 if (interactive.tempplot.totalPopulation >= 1.0f)
1464 {
1465 if (interactive.tempplot.procstorfood == 0.0f)
1466 {
1467 DrawTextW(L"** We desperately need food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1468 y += 15;
1469 }
1470 else
1471 {
1472 if ((interactive.tempplot.totalPopulation * 0.00109589f * 7.0f) > interactive.tempplot.procstorfood)
1473 {
1474 DrawTextW(L"++ We have less than a week's supply of food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1475 y += 15;
1476 }
1477 }
1478 if (interactive.tempplot.procstorfuel <= 0)
1479 {
1480 DrawTextW(L"++ We are experiencing power outages, no more refined Iagreous fuel!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1481 y += 15;
1482 }
1483 }
1484 if (interactive.tempplot.colonyUplink == 0)
1485 {
1486 DrawTextW(L"++ The colony up-link has failed!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1487 y += 15;
1488 }
1489 if (floorf(interactive.tempplot.totalPopulation) > interactive.tempplot.maxcolstor)
1490 {
1491 DrawTextW(L"++ The colony is overpopulated!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1492 y += 15;
1493 }
1494 if (interactive.tempplot.colonistsbuilding > 0)
1495 {
1496 swprintf_s(str, 99, L".. We have %i people reassigned for construction", interactive.tempplot.colonistsbuilding);
1497 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1498 y += 15;
1499 }
1500 if (interactive.tempplot.workingPopulation < interactive.mincoltorun)
1501 {
1502 swprintf_s(str, 99, L".. We are understaffed by %i workers", static_cast<short>(interactive.mincoltorun) - interactive.tempplot.workingPopulation);
1503 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1504 y += 15;
1505 }
1506 if (y == 45)
1507 {
1508 DrawTextW(L".. No new messages!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1509 }
1510 }
1511 else if (interactive.menutype == 142 || interactive.menutype == 143) // airfield expansion/demolition
1512 {
1513 float gradeadj = 1.0f; // airfields have to be flat so no premium for foundations!
1514 if (interactive.menutype == 143) // demolition
1515 gradeadj *= 0.2625f;
1516 if (interactive.tempplot.constructime == 0L)
1517 {
1518 if (interactive.menutype == 142)
1519 {
1520 swprintf_s(str, 99,
1521 L" Availability for construction %7i MT common %i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
1522 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1523 swprintf_s(str, 99,
1524 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
1525 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1526 }
1527 else
1528 {
1529 swprintf_s(str, 99,
1530 L" Availability for demolition %7i MT common %i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
1531 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1532 swprintf_s(str, 99,
1533 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
1534 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1535 }
1536 }
1537 else
1538 {
1539 char timerem[99];
1540 if (interactive.tempplot.constructime > 103896L)
1541 sprintf_s(timerem, sizeof(timerem), "%5i days left ", interactive.tempplot.constructime / 51948L); // vieneo days
1542 else if (interactive.tempplot.constructime > 3600L)
1543 sprintf_s(timerem, sizeof(timerem), "%5i hours left ", interactive.tempplot.constructime / 3600L);
1544 else if (interactive.tempplot.constructime > 60L)
1545 sprintf_s(timerem, sizeof(timerem), "%5i minutes left", interactive.tempplot.constructime / 60L);
1546 else
1547 sprintf_s(timerem, sizeof(timerem), "One minute left!");
1548
1549 swprintf_s(str, 99,
1550 L" CONSTRUCTION IN PROGRESS %S (%i colonists building)", timerem, interactive.tempplot.colonistsbuilding);
1551 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1552 }
1553
1554 if (interactive.menutype == 142)
1555 {
1556 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Needed Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1557 }
1558 else
1559 {
1560 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Recycled Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1561 }
1562 swprintf_s(str, 99,
1563 L"1] Fixed-base Operator %-4i 2 5 colonists %3.0f MT common 1 labor", interactive.type1built, ceilf(23.37f * gradeadj));
1564 DrawTextW(str, 0, 50, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1565 swprintf_s(str, 99,
1566 L" %3.0f MT fabricated", ceilf(17.13f * gradeadj));
1567 DrawTextW(str, 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1568
1569#pragma region Runway
1570 if (interactive.menutype == 142)
1571 {
1572 // ReSharper disable once CppIdenticalOperandsInBinaryExpression
1573 if (!(0x80000000 >> (96 - 96) & interactive.tempplot.layout4))
1574 {
1575 swprintf_s(str, 99,
1576 L"2] Runway 0 1 Phase 1/3 %3.0f MT common 4 labor", ceilf(0.0f * gradeadj));
1577 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1578 swprintf_s(str, 99,
1579 L" Marston Mat %3.0f MT fabricated", ceilf(531.0f * gradeadj));
1580 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1581 }
1582 else if (!(0x80000000 >> (97 - 96) & interactive.tempplot.layout4))
1583 {
1584 swprintf_s(str, 99,
1585 L"2] Runway 0 1 Phase 2/3 %3.0f MT common 4 labor", ceilf(0.0f * gradeadj));
1586 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1587 swprintf_s(str, 99,
1588 L" Marston Mat %3.0f MT fabricated", ceilf(531.0f * gradeadj));
1589 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1590 }
1591 else if ((!(0x80000000 >> (98 - 96) & interactive.tempplot.layout4)))
1592 {
1593 swprintf_s(str, 99,
1594 L"2] Runway 0 1 Phase 3/3 %3.0f MT common 4 labor", ceilf(0.0f * gradeadj));
1595 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1596 swprintf_s(str, 99,
1597 L" Marston Mat %3.0f MT fabricated", ceilf(531.0f * gradeadj));
1598 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1599 }
1600 else
1601 {
1602 swprintf_s(str, 99,
1603 L"2] Runway 1 1 %3.0f MT common 4 labor", ceilf(0.0f * gradeadj));
1604 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1605 swprintf_s(str, 99,
1606 L" Marston Mat %3.0f MT fabricated", ceilf(1593.0f * gradeadj));
1607 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1608 }
1609 }
1610 else if (interactive.menutype == 143)
1611 {
1612 // ReSharper disable once CppIdenticalOperandsInBinaryExpression
1613 if (!(0x80000000 >> (96 - 96) & interactive.tempplot.layout4))
1614 {
1615 swprintf_s(str, 99,
1616 L"2] Runway 0 1 %3.0f MT common 4 labor", ceilf(0.0f * gradeadj));
1617 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1618 swprintf_s(str, 99,
1619 L" %3.0f MT fabricated", ceilf(1593.0f * gradeadj));
1620 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1621 }
1622 else if (!(0x80000000 >> (97 - 96) & interactive.tempplot.layout4))
1623 {
1624 swprintf_s(str, 99,
1625 L"2] Runway 0 1 Phase 1/3 %3.0f MT common 4 labor", ceilf(0.0f * gradeadj));
1626 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1627 swprintf_s(str, 99,
1628 L" Marston Mat %3.0f MT fabricated", ceilf(531.0f * gradeadj));
1629 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1630 }
1631 else if (!(0x80000000 >> (98 - 96) & interactive.tempplot.layout4))
1632 {
1633 swprintf_s(str, 99,
1634 L"2] Runway 0 1 Phase 2/3 %3.0f MT common 4 labor", ceilf(0.0f * gradeadj));
1635 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1636 swprintf_s(str, 99,
1637 L" Marston Mat %3.0f MT fabricated", ceilf(531.0f * gradeadj));
1638 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1639 }
1640 else
1641 {
1642 swprintf_s(str, 99,
1643 L"2] Runway 1 1 Phase 3/3 %3.0f MT common 4 labor", ceilf(0.0f * gradeadj));
1644 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1645 swprintf_s(str, 99,
1646 L" Marston Mat %3.0f MT fabricated", ceilf(531.0f * gradeadj));
1647 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1648 }
1649 }
1650#pragma endregion
1651
1652 swprintf_s(str, 99,
1653 L"3] Terminal %-4i 1 8 colonists %3.0f MT common 11 labor", interactive.type3built, ceilf(267.01f * gradeadj));
1654 DrawTextW(str, 0, 100, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1655 swprintf_s(str, 99,
1656 L" 20479 MT storage %3.0f MT fabricated", ceilf(195.72f * gradeadj));
1657 DrawTextW(str, 0, 110, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1658
1659 swprintf_s(str, 99,
1660 L"4] Hangar %-4i 1 6 colonists %3.0f MT common 61 labor", interactive.type4built, ceilf(143.04f * gradeadj));
1661 DrawTextW(str, 0, 125, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1662 swprintf_s(str, 99,
1663 L" %3.0f MT fabricated", ceilf(104.85f * gradeadj));
1664 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1665
1666 swprintf_s(str, 99,
1667 L"5] Hotel %-4i 2 824 colonists %3.0f MT common 6 labor", interactive.type5built, ceilf(151.13f * gradeadj));
1668 DrawTextW(str, 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1669 swprintf_s(str, 99,
1670 L" %3.0f MT fabricated", ceilf(110.78f * gradeadj));
1671 DrawTextW(str, 0, 160, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1672
1673 swprintf_s(str, 99,
1674 L"6] Fuel Farm %-4i 2 25810 MT storage %3.0f MT common 5 labor", interactive.type6built, ceilf(58.57f * gradeadj));
1675 DrawTextW(str, 0, 175, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1676 swprintf_s(str, 99,
1677 L" %3.0f MT fabricated", ceilf(42.93f * gradeadj));
1678 DrawTextW(str, 0, 185, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1679
1680 swprintf_s(str, 99,
1681 L"7] Support Structures %-4i 5 %3.0f MT common 2 labor", interactive.type7built, ceilf(42.96f * gradeadj));
1682 DrawTextW(str, 0, 200, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1683 swprintf_s(str, 99,
1684 L" %3.0f MT fabricated", ceilf(31.49f * gradeadj));
1685 DrawTextW(str, 0, 210, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1686
1687 swprintf_s(str, 99,
1688 L"8] Power Production %-4i 1 212 GJ daily %3.0f MT common 1 labor", interactive.type8built, ceilf(31.88f * gradeadj));
1689 DrawTextW(str, 0, 225, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1690 swprintf_s(str, 99,
1691 L" 1 colonist %3.0f MT fabricated", ceilf(23.37f * gradeadj));
1692 DrawTextW(str, 0, 235, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1693
1694 swprintf_s(str, 99,
1695 L"9] Control Tower %-4i 1 1 colonist %3.0f MT common 2 labor", interactive.type9built, ceilf(36.40f * gradeadj));
1696 DrawTextW(str, 0, 250, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1697 swprintf_s(str, 99,
1698 L" %3.0f MT fabricated", ceilf(26.68f * gradeadj));
1699 DrawTextW(str, 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1700 }
1701 else if (interactive.menutype == 16) // colony territory inventory
1702 {
1703 DrawTextW(L" Inventory Type Inventory Units", 0, 30, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1704
1705 for (size_t i = 0; i < 9; i++)
1706 {
1707 if (interactive.inventory[i].type == 0)
1708 break;
1709 if (interactive.inventory[i].type == 1) // General
1710 {
1711 switch (interactive.inventory[i].subtype)
1712 {
1713 case KitType::LockPick:
1714 swprintf_s(str, 99, L"%zu] Lock Pick Set %3i", i + 1, interactive.inventory[i].quantity); break;
1716 swprintf_s(str, 99, L"%zu] Binoculars %3i", i + 1, interactive.inventory[i].quantity); break;
1717 case KitType::ATM:
1718 swprintf_s(str, 99, L"%zu] ATM %3i", i + 1, interactive.inventory[i].quantity); break;
1720 swprintf_s(str, 99, L"%zu] Night Vision %3i", i + 1, interactive.inventory[i].quantity); break;
1722 swprintf_s(str, 99, L"%zu] E-11 Upgrade Voucher %3i", i + 1, interactive.inventory[i].quantity); break;
1724 swprintf_s(str, 99, L"%zu] Sunglasses %3i", i + 1, interactive.inventory[i].quantity); break;
1725 case KitType::Fireworks:
1726 swprintf_s(str, 99, L"%zu] Fireworks %3i", i + 1, interactive.inventory[i].quantity); break;
1728 swprintf_s(str, 99, L"%zu] Temp Runway Lights %3i", i + 1, interactive.inventory[i].quantity); break;
1730 swprintf_s(str, 99, L"%zu] Colony Up-link %3i", i + 1, interactive.inventory[i].quantity); break;
1731 case KitType::FirstAid:
1732 swprintf_s(str, 99, L"%zu] First Aid Kit %3i", i + 1, interactive.inventory[i].quantity); break;
1733 case KitType::CandyCane:
1734 swprintf_s(str, 99, L"%zu] Candy Cane %3i", i + 1, interactive.inventory[i].quantity); break;
1735 case KitType::EVA_KIT:
1736 swprintf_s(str, 99, L"%zu] EVA Suit %3i", i + 1, interactive.inventory[i].quantity); break;
1737 case KitType::Backpack:
1738 swprintf_s(str, 99, L"%zu] Backpack %3i", i + 1, interactive.inventory[i].quantity); break;
1740 swprintf_s(str, 99, L"%zu] Cigarettes, Carton %3i", i + 1, interactive.inventory[i].quantity); break;
1741 case KitType::Polaroid:
1742 swprintf_s(str, 99, L"%zu] Polaroid Picture %3i", i + 1, interactive.inventory[i].quantity); break;
1743 default:
1744 swprintf_s(str, 99, L" UNKNOWN GENERAL SUB %3i", interactive.inventory[i].quantity); break;
1745 }
1746 }
1747 else if (interactive.inventory[i].type == 2) // Avionics
1748 {
1749 swprintf_s(str, 99, L" UNKNOWN AVIONICS SUB %3i", interactive.inventory[i].quantity);
1750 }
1751 else if (interactive.inventory[i].type == 3) // Weapons
1752 {
1753 switch (interactive.inventory[i].subtype)
1754 {
1755 case 1:
1756 swprintf_s(str, 99, L"%zu] Fuzer Launcher %3i", i + 1, interactive.inventory[i].quantity); break;
1757 case 2:
1758 swprintf_s(str, 99, L"%zu] Sinker Launcher %3i", i + 1, interactive.inventory[i].quantity); break;
1759 case 3:
1760 swprintf_s(str, 99, L"%zu] Longarm Launcher %3i", i + 1, interactive.inventory[i].quantity); break;
1761 default:
1762 swprintf_s(str, 99, L" UNKNOWN WEAPONS SUB %3i", interactive.inventory[i].quantity); break;
1763 }
1764 }
1765 else
1766 {
1767 swprintf_s(str, 99, L" UNKNOWN TYPE %3i", interactive.inventory[i].quantity);
1768 }
1769 DrawTextW(str, 0, 70 + 25 * i, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1770 }
1771 }
1772 else if (interactive.menutype == 151) // Refinery Control Center
1773 {
1774 if (interactive.tempplot.colonyName[0] == 0)
1775 {
1776 if (interactive.tempplot.boundaryName[0] == 0)
1777 swprintf_s(str, 99, L" Welcome! (population %.0f)", floorf(interactive.tempplot.totalPopulation));
1778 else
1779 swprintf_s(str, 99, L" Welcome to %S! (population %.0f)", interactive.tempplot.boundaryName, floorf(interactive.tempplot.totalPopulation));
1780 }
1781 else
1782 {
1783 if (interactive.tempplot.boundaryName[0] == 0)
1784 swprintf_s(str, 99, L" Welcome to %S (population %.0f)", interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
1785 else
1786 swprintf_s(str, 99, L" Welcome to %S %S (population %.0f)", interactive.tempplot.boundaryName, interactive.tempplot.colonyName, floorf(interactive.tempplot.totalPopulation));
1787 }
1788 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1789
1790 float opeff;
1791 if (interactive.tempplot.workingPopulation >= 1.0f && interactive.mincoltorun > 0.0f)
1792 {
1793 opeff = (interactive.tempplot.workingPopulation * 0.75f - (float)interactive.tempplot.colonistsbuilding) / interactive.mincoltorun;
1794 if (opeff > 1.0f)
1795 opeff = 1.0f;
1796 else if (opeff < 0.0f)
1797 opeff = 0.0f;
1798 opeff *= 0.5f + (float)interactive.type7built / 5.0f; // half as efficient to 1.5 times as efficient
1799 }
1800 else
1801 opeff = 0.0f;
1802
1803 swprintf_s(str, 99,
1804 L" APN: %i%04i (%.0f%% efficiency)", interactive.tcp.u + 3038, interactive.tcp.v + 2038, opeff * 100.0f);
1805 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1806
1807
1808 DrawTextW(L"1] Survey", 0, 45, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1809 DrawTextW(L"2] Inventory Management", 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1810 DrawTextW(L"3] Expansion", 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1811 DrawTextW(L"4] Demolition", 0, 90, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1812 DrawTextW(L"5] Manage Trade", 0, 105, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1813 DrawTextW(L"6] Cargo Operations", 0, 120, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1814 if (interactive.tempplot.ATMcharge > -1)
1815 swprintf_s(str, 99, L"7] Set ATM Fee (%i CR)", interactive.tempplot.ATMcharge);
1816 else
1817 wcscpy_s(str, 99, L" No ATM Installed");
1818 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1819 DrawTextW(L"8] Diplomacy", 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1820
1821 float fuelprod = 0.0f;
1822 float fuelused = 0.0f;
1823 if (interactive.tempplot.procstorfuelore > interactive.tempplot.minD && interactive.tempplot.procstorfuel < interactive.tempplot.maxG)
1824 {
1825 float staff = interactive.tempplot.workingPopulation;
1826 fuelprod += staff / 250.0f * interactive.tempplot.DlyXtractHarvestProduce * opeff; // takes 140 people to produce 4.08 MT of fuel ore
1827 fuelused += staff / 250.0f * interactive.tempplot.DlyXtractHarvestProduce * opeff / 0.4642857143f; // 42 gal becomes 19.5 gal
1828 }
1829
1830 // production and consumption totals
1831 swprintf_s(str, 99,
1832 L" Daily Production: %.3f MT refined fuel", fuelprod);
1833 DrawTextW(str, 0, 170, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1834
1835 swprintf_s(str, 99,
1836 L" Commodity Daily Consumption");
1837 DrawTextW(str, 0, 205, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1838 swprintf_s(str, 99,
1839 L" Rare %.3f MT", 0.0);
1840 DrawTextW(str, 0, 215, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1841 swprintf_s(str, 99,
1842 L" Foodstuffs %.3f MT", interactive.tempplot.totalPopulation * 0.00109589f);
1843 DrawTextW(str, 0, 225, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1844 swprintf_s(str, 99,
1845 L" Common %.3f MT", 0.0);
1846 DrawTextW(str, 0, 235, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1847 swprintf_s(str, 99,
1848 L" Fuel Ore %.3f MT", fuelused);
1849 DrawTextW(str, 0, 245, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1850 swprintf_s(str, 99,
1851 L" Goods %.3f MT", 0.0f);
1852 DrawTextW(str, 0, 255, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1853 swprintf_s(str, 99,
1854 L" Materials %.3f MT", 0.0f);
1855 DrawTextW(str, 0, 265, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1856 swprintf_s(str, 99,
1857 L" Fuel %.3f MT", interactive.tempplot.totalPopulation * 0.000011785f);
1858 DrawTextW(str, 0, 275, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1859
1860
1861 // important messages
1862 short x = 210, y = 45;
1863 if (interactive.tempplot.totalPopulation >= 1.0f)
1864 {
1865 if (interactive.tempplot.procstorfood == 0.0f)
1866 {
1867 DrawTextW(L"** We desperately need food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1868 y += 15;
1869 }
1870 else
1871 {
1872 if ((interactive.tempplot.totalPopulation * 0.00109589f * 7.0f) > interactive.tempplot.procstorfood)
1873 {
1874 DrawTextW(L"++ We have less than a week's supply of food!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1875 y += 15;
1876 }
1877 }
1878 if (interactive.tempplot.procstorfuel <= 0)
1879 {
1880 DrawTextW(L"++ We are experiencing power outages, no more refined Iagreous fuel!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1881 y += 15;
1882 }
1883 }
1884 if (interactive.tempplot.colonyUplink == 0)
1885 {
1886 DrawTextW(L"++ The colony up-link has failed!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1887 y += 15;
1888 }
1889 if (floorf(interactive.tempplot.totalPopulation) > interactive.tempplot.maxcolstor)
1890 {
1891 DrawTextW(L"++ The colony is overpopulated!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1892 y += 15;
1893 }
1894 if (interactive.tempplot.colonistsbuilding > 0)
1895 {
1896 swprintf_s(str, 99, L".. We have %i people reassigned for construction", interactive.tempplot.colonistsbuilding);
1897 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1898 y += 15;
1899 }
1900 if (interactive.tempplot.workingPopulation < interactive.mincoltorun)
1901 {
1902 swprintf_s(str, 99, L".. We are understaffed by %i workers", static_cast<short>(interactive.mincoltorun) - interactive.tempplot.workingPopulation);
1903 DrawTextW(str, x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1904 y += 15;
1905 }
1906 if (y == 45)
1907 {
1908 DrawTextW(L".. No new messages!", x, y, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1909 }
1910 }
1911 else if (interactive.menutype == 152 || interactive.menutype == 153) // refinery expansion/demolition
1912 {
1913 float gradeadj = 1.0f; // airfields have to be flat so no premium for foundations!
1914 if (interactive.menutype == 153) // demolition
1915 gradeadj *= 0.2625f;
1916 if (interactive.tempplot.constructime == 0L)
1917 {
1918 if (interactive.menutype == 152)
1919 {
1920 swprintf_s(str, 99,
1921 L" Availability for construction %7i MT common %i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
1922 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1923 swprintf_s(str, 99,
1924 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
1925 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1926 }
1927 else
1928 {
1929 swprintf_s(str, 99,
1930 L" Availability for demolition %7i MT common %i labor", (int)interactive.tempplot.procstorC, (short)floorf(interactive.colonistsforbuilding));
1931 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1932 swprintf_s(str, 99,
1933 L" %7i MT fabricated", (int)interactive.tempplot.procstormaterials);
1934 DrawTextW(str, 0, 20, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1935 }
1936 }
1937 else
1938 {
1939 char timerem[99];
1940 if (interactive.tempplot.constructime > 103896L)
1941 sprintf_s(timerem, sizeof(timerem), "%5i days left ", interactive.tempplot.constructime / 51948L); // vieneo days
1942 else if (interactive.tempplot.constructime > 3600L)
1943 sprintf_s(timerem, sizeof(timerem), "%5i hours left ", interactive.tempplot.constructime / 3600L);
1944 else if (interactive.tempplot.constructime > 60L)
1945 sprintf_s(timerem, sizeof(timerem), "%5i minutes left", interactive.tempplot.constructime / 60L);
1946 else
1947 sprintf_s(timerem, sizeof(timerem), "One minute left!");
1948
1949 swprintf_s(str, 99,
1950 L" CONSTRUCTION IN PROGRESS %S (%i colonists building)", timerem, interactive.tempplot.colonistsbuilding);
1951 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1952 }
1953
1954 if (interactive.menutype == 142)
1955 {
1956 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Needed Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1957 }
1958 else
1959 {
1960 DrawTextW(L" Structure Type Built Zoned Adds Capacity Materials Recycled Colonists", 0, 35, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1961 }
1962 swprintf_s(str, 99,
1963 L"1] Control Center %-4i 1 25 colonists %3.0f MT common 15 labor", interactive.type1built, ceilf(23.37f * gradeadj));
1964 DrawTextW(str, 0, 50, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1965 swprintf_s(str, 99,
1966 L" %3.0f MT fabricated", ceilf(17.13f * gradeadj));
1967 DrawTextW(str, 0, 60, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1968
1969 swprintf_s(str, 99,
1970 L"2] Refining %-4i 3 20 MT daily %3.0f MT common 4 labor", interactive.type2built, ceilf(489.57f * gradeadj));
1971 DrawTextW(str, 0, 75, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1972 swprintf_s(str, 99,
1973 L" %3.0f MT fabricated", ceilf(358.85f * gradeadj));
1974 DrawTextW(str, 0, 85, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1975
1976 swprintf_s(str, 99,
1977 L"3] Residences %-4i 1 932 colonists %3.0f MT common 2 labor", interactive.type3built, ceilf(300.73f * gradeadj));
1978 DrawTextW(str, 0, 100, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1979 swprintf_s(str, 99,
1980 L" %3.0f MT fabricated", ceilf(220.43f * gradeadj));
1981 DrawTextW(str, 0, 110, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1982
1983 /*swprintf_s(str, 99,
1984 L"4] Hangar %-4i 1 6 colonists %3.0f MT common 61 labor", interactive.type4built, ceilf(143.04f * gradeadj));
1985 DrawTextW(str, 0, 125, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1986 swprintf_s(str, 99,
1987 L" %3.0f MT fabricated", ceilf(104.85f * gradeadj));
1988 DrawTextW(str, 0, 135, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1989
1990 swprintf_s(str, 99,
1991 L"5] Hotel %-4i 2 824 colonists %3.0f MT common 6 labor", interactive.type5built, ceilf(151.13f * gradeadj));
1992 DrawTextW(str, 0, 150, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
1993 swprintf_s(str, 99,
1994 L" %3.0f MT fabricated", ceilf(110.78f * gradeadj));
1995 DrawTextW(str, 0, 160, 0.1f, DT_NOCLIP, 0xFFA0A0A0);*/
1996
1997 swprintf_s(str, 99,
1998 L"6] Fuel Storage %-4i 6 14777 MT storage %3.0f MT common 3 labor", interactive.type6built, ceilf(33.53f * gradeadj));
1999 DrawTextW(str, 0, 175, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2000 swprintf_s(str, 99,
2001 L" %3.0f MT fabricated", ceilf(24.58f * gradeadj));
2002 DrawTextW(str, 0, 185, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2003
2004 swprintf_s(str, 99,
2005 L"7] Support Structures %-4i 5 %3.0f MT common 2 labor", interactive.type7built, ceilf(42.96f * gradeadj));
2006 DrawTextW(str, 0, 200, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2007 swprintf_s(str, 99,
2008 L" %3.0f MT fabricated", ceilf(31.49f * gradeadj));
2009 DrawTextW(str, 0, 210, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2010
2011 swprintf_s(str, 99,
2012 L"8] Power Production %-4i 1 212 GJ daily %3.0f MT common 1 labor", interactive.type8built, ceilf(31.88f * gradeadj));
2013 DrawTextW(str, 0, 225, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2014 swprintf_s(str, 99,
2015 L" 1 colonist %3.0f MT fabricated", ceilf(23.37f * gradeadj));
2016 DrawTextW(str, 0, 235, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2017
2018 swprintf_s(str, 99,
2019 L"9] Off-gas Tower %-4i 2 1 colonist %3.0f MT common 2 labor", interactive.type9built, ceilf(36.40f * gradeadj));
2020 DrawTextW(str, 0, 250, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2021 swprintf_s(str, 99,
2022 L" %3.0f MT fabricated", ceilf(26.68f * gradeadj));
2023 DrawTextW(str, 0, 260, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2024 }
2025 else // new advanced plot management
2026 {
2027 // 21-27 for grade A through refined fuel
2028 int maxonhand, minonhand, buyingprice, sellingprice;
2029 char stafftoproduce;
2030 switch (interactive.menutype)
2031 {
2032 case 21: swprintf_s(str, 99, L" Rare/Precious %.0f MT on hand", floorf(interactive.tempplot.procstorA));
2033 maxonhand = interactive.tempplot.maxA;
2034 minonhand = interactive.tempplot.minA;
2035 buyingprice = interactive.tempplot.buyA;
2036 sellingprice = interactive.tempplot.sellA;
2037 stafftoproduce = 0;
2038 break;
2039 case 22: swprintf_s(str, 99, L" Foodstuffs %.0f MT on hand", floorf(interactive.tempplot.procstorfood));
2040 maxonhand = interactive.tempplot.maxB;
2041 minonhand = interactive.tempplot.minB;
2042 buyingprice = interactive.tempplot.buyB;
2043 sellingprice = interactive.tempplot.sellB;
2044 stafftoproduce = 0;
2045 break;
2046 case 23: swprintf_s(str, 99, L" Common Materials %.0f MT on hand", floorf(interactive.tempplot.procstorC));
2047 maxonhand = interactive.tempplot.maxC;
2048 minonhand = interactive.tempplot.minC;
2049 buyingprice = interactive.tempplot.buyC;
2050 sellingprice = interactive.tempplot.sellC;
2051 stafftoproduce = 0;
2052 break;
2053 case 24: swprintf_s(str, 99, L" Fuel Ore %.0f MT on hand", floorf(interactive.tempplot.procstorfuelore));
2054 maxonhand = interactive.tempplot.maxD;
2055 minonhand = interactive.tempplot.minD;
2056 buyingprice = interactive.tempplot.buyD;
2057 sellingprice = interactive.tempplot.sellD;
2058 stafftoproduce = 0;
2059 break;
2060 case 25: swprintf_s(str, 99, L" Consumer Goods %.0f MT on hand", floorf(interactive.tempplot.procstorgoods));
2061 maxonhand = interactive.tempplot.maxE;
2062 minonhand = interactive.tempplot.minE;
2063 buyingprice = interactive.tempplot.buyE;
2064 sellingprice = interactive.tempplot.sellE;
2065 stafftoproduce = interactive.tempplot.makeE;
2066 break;
2067 case 26: swprintf_s(str, 99, L" Fabricated Materials %.0f MT on hand", floorf(interactive.tempplot.procstormaterials));
2068 maxonhand = interactive.tempplot.maxF;
2069 minonhand = interactive.tempplot.minF;
2070 buyingprice = interactive.tempplot.buyF;
2071 sellingprice = interactive.tempplot.sellF;
2072 stafftoproduce = interactive.tempplot.makeF;
2073 break;
2074 case 27: swprintf_s(str, 99, L" Refined Fuel %.0f MT on hand", floorf(interactive.tempplot.procstorfuel));
2075 maxonhand = interactive.tempplot.maxG;
2076 minonhand = interactive.tempplot.minG;
2077 buyingprice = interactive.tempplot.buyG;
2078 sellingprice = interactive.tempplot.sellG;
2079 stafftoproduce = interactive.tempplot.makeG;
2080 break;
2081 default:
2082 return;
2083 }
2084
2085 DrawTextW(str, 0, 10, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2086
2087 DrawTextW(L" Option Type Value", 0, 45, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2088
2089 swprintf_s(str, 99, L"1] Maximum on hand %i MT", maxonhand);
2090 DrawTextW(str, 0, 65, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2091 if (buyingprice > 0)
2092 swprintf_s(str, 99, L"2] Buying price %i CR per MT", buyingprice);
2093 else
2094 swprintf_s(str, 99, L"2] Buying price Not trading...");
2095 DrawTextW(str, 0, 90, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2096
2097 if (interactive.tempplot.type == PlotType::UserTownship && (interactive.menutype == 25 || interactive.menutype == 26 || interactive.menutype == 27))
2098 swprintf_s(str, 99, L"3] Staff to produce %i%% (%.0f colonists)", stafftoproduce, floorf(interactive.tempplot.workingPopulation * 0.25f * (float)stafftoproduce * 0.01f));
2099 else
2100 swprintf_s(str, 99, L"3] Staff to produce N/A");
2101
2102 // 21 a 22 b 23 c 24 d 25 e 26 f 27 g
2103 if (interactive.tempplot.type == PlotType::UserTownship && (interactive.menutype == 25 || interactive.menutype == 26 || interactive.menutype == 27))
2104 DrawTextW(str, 0, 115, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2105 else
2106 DrawTextW(str, 0, 115, 0.1f, DT_NOCLIP, 0xFF505050);
2107
2108 //if (interactive.tempplot.type == PlotType::UserTownship)
2109 // swprintf_s(str, 99, L" Staff to transfer %i%% (%.0f colonists)", 0, 0.0f);
2110 //else
2111 // swprintf_s(str, 99, L" Staff to transfer %i%% (%.0f colonists)", 0, 0.0f);
2112 //DrawTextW(str, 0, 140, 0.1f, DT_NOCLIP, 0xFF505050);
2113
2114 //DrawTextW(L" Manage Transfers Use Player Portal", 0, 165, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2115
2116 if (sellingprice > 0)
2117 swprintf_s(str, 99, L"6] Selling price %i CR per MT", sellingprice);
2118 else
2119 swprintf_s(str, 99, L"6] Selling price Not trading...");
2120 DrawTextW(str, 0, 190, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2121
2122 swprintf_s(str, 99, L"7] Minimum on hand %i MT", minonhand);
2123 DrawTextW(str, 0, 215, 0.1f, DT_NOCLIP, 0xFFA0A0A0);
2124 }
2125}
2126
2127bool Intermedia::HandleKeyPress(short key, bool shift)
2128{
2129 logger->AddToCallStack("Intermedia::HandleKeyPress");
2130 if (!interactive.avail || g_bTextInput || shift)
2131 return false;
2132
2133 switch (key)
2134 {
2135 case 2: // 1
2136 case 3: // 2
2137 case 4: // 3
2138 case 5: // 4
2139 case 6: // 5
2140 case 7: // 6
2141 case 8: // 7
2142 case 9: // 8
2143 case 10: // 9
2144 case 11: // 0
2146 return true;
2147 }
2148
2149 return false;
2150}
@ UserTownship
@ Fireworks
@ LockPick
@ FirstAid
@ E11Upgrade
@ Binoculars
@ TemporaryRunwayLights
@ Polaroid
@ EVA_KIT
@ NightVision
@ ColonyUpLink
@ ATM
@ Sunglasses
@ Backpack
@ CartonOfCigarettes
@ CandyCane
Definition Bus.h:20
Instrument(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font * > prmFonts)
Definition Instrument.h:36
Logger * logger
Definition Instrument.h:23
DeviceObject * pDevice
Definition Instrument.h:21
UINT defaultFont
Definition Instrument.h:24
Sprite * mine
Definition Instrument.h:132
void Render() override
bool HandleKeyPress(short key, bool shift) override
Intermedia(int prmX, int prmY, float prmXScale, float prmYScale, Bus *prmBus, Logger *prmLogger, DeviceObject *prmDevice, std::vector< Font * > prmFonts)
Definition Intermedia.cpp:4
void AddToCallStack(const char *msg)
Definition Logger.cpp:355
Sprite(Logger *prmLogger, DeviceObject *prmpDevice, std::string prmPathAndFilename, int prmX, int prmY, float prmZ, int prmTop, int prmLeft, int prmWidth, int prmHeight, DWORD prmColor, float scaleX=1.0f, float scaleY=1.0f)
Definition Sprite.cpp:5
void Draw(RiseMath::Color prmColor)
Definition Sprite.cpp:75
Sinteractive interactive
Definition globals.cpp:120
char g_bTextInput
Definition globals.cpp:61
constexpr auto Min(A first, B second)
Definition ClientMath.h:15
short outboundMenuSelect
Definition globals.h:785
short type7built
Definition globals.h:796
short type5built
Definition globals.h:796
short type4built
Definition globals.h:796
short type6built
Definition globals.h:796
short type3built
Definition globals.h:796
VECTOR2SHORT tcp
Definition globals.h:786
short type9built
Definition globals.h:796
unsigned char menutype
Definition globals.h:784
short type1built
Definition globals.h:796
short type8built
Definition globals.h:796
float mincoltorun
Definition globals.h:795
short type2built
Definition globals.h:796
float colonistsforbuilding
Definition globals.h:795