forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
computer.cpp
1519 lines (1403 loc) · 56 KB
/
computer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "computer.h"
#include "game.h"
#include "map.h"
#include "debug.h"
#include "monster.h"
#include "overmap.h"
#include "output.h"
#include "json.h"
#include "overmapbuffer.h"
#include "messages.h"
#include "sounds.h"
#include "rng.h"
#include "mission.h"
#include "translations.h"
#include "monster.h"
#include "event.h"
#include "trap.h"
#include "mtype.h"
#include "field.h"
#include "player.h"
#include "text_snippets.h"
#include "input.h"
#include <string>
#include <sstream>
#include <algorithm>
const mtype_id mon_manhack( "mon_manhack" );
const mtype_id mon_secubot( "mon_secubot" );
const skill_id skill_computer( "computer" );
const species_id ZOMBIE( "ZOMBIE" );
const efftype_id effect_amigara( "amigara" );
const efftype_id effect_stemcell_treatment( "stemcell_treatment" );
int alerts = 0;
computer::computer( const std::string &new_name, int new_security ): name( new_name )
{
security = new_security;
w_terminal = NULL;
w_border = NULL;
mission_id = -1;
}
computer::~computer()
{
if (w_terminal != NULL) {
delwin(w_terminal);
}
if (w_border != NULL) {
delwin(w_border);
}
}
computer &computer::operator=(const computer &rhs)
{
security = rhs.security;
name = rhs.name;
mission_id = rhs.mission_id;
options = rhs.options;
failures = rhs.failures;
w_terminal = NULL;
w_border = NULL;
return *this;
}
void computer::set_security(int Security)
{
security = Security;
}
void computer::add_option(std::string opt_name, computer_action action,
int Security)
{
options.push_back(computer_option(opt_name, action, Security));
}
void computer::add_failure(computer_failure failure)
{
failures.push_back(failure);
}
void computer::shutdown_terminal()
{
// So yeah, you can reset the term by logging off.
// Otherwise, it's persistent across all terms.
// Decided to go easy on people for now.
alerts = 0;
werase(w_terminal);
delwin(w_terminal);
w_terminal = NULL;
werase(w_border);
delwin(w_border);
w_border = NULL;
}
void computer::use()
{
if (w_border == NULL) {
w_border = newwin(FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH,
(TERMY > FULL_SCREEN_HEIGHT) ? (TERMY - FULL_SCREEN_HEIGHT) / 2 : 0,
(TERMX > FULL_SCREEN_WIDTH) ? (TERMX - FULL_SCREEN_WIDTH) / 2 : 0);
}
if (w_terminal == NULL) {
w_terminal = newwin(getmaxy(w_border) - 2, getmaxx(w_border) - 2,
getbegy(w_border) + 1, getbegx(w_border) + 1);
}
draw_border(w_border);
wrefresh(w_border);
// Login
print_line(_("Logging into %s..."), name.c_str());
if (security > 0) {
if (int(calendar::turn) < next_attempt) {
print_error( _("Access is temporary blocked for security purposes.") );
query_any(_("Please contact the system administrator."));
reset_terminal();
return;
}
print_error(_("ERROR! Access denied!"));
switch (query_ynq(_("Bypass security?"))) {
case 'q':
case 'Q':
shutdown_terminal();
return;
case 'n':
case 'N':
query_any(_("Shutting down... press any key."));
shutdown_terminal();
return;
case 'y':
case 'Y':
if (!hack_attempt(&(g->u))) {
if (failures.empty()) {
query_any(_("Maximum login attempts exceeded. Press any key..."));
shutdown_terminal();
return;
}
activate_random_failure();
shutdown_terminal();
return;
} else { // Successful hack attempt
security = 0;
query_any(_("Login successful. Press any key..."));
reset_terminal();
}
}
} else { // No security
query_any(_("Login successful. Press any key..."));
reset_terminal();
}
// Main computer loop
while(true) {
//reset_terminal();
size_t options_size = options.size();
print_newline();
print_line("%s - %s", name.c_str(), _("Root Menu"));
for (size_t i = 0; i < options_size; i++) {
print_line("%d - %s", i + 1, options[i].name.c_str());
}
print_line("Q - %s", _("Quit and shut down"));
print_newline();
char ch;
do {
// TODO: use input context
ch = inp_mngr.get_input_event().get_first_input();
} while (ch != 'q' && ch != 'Q' && (ch < '1' || ch - '1' >= (char)options_size));
if (ch == 'q' || ch == 'Q') {
break; // Exit from main computer loop
} else { // We selected an option other than quit.
ch -= '1'; // So '1' -> 0; index in options.size()
computer_option current = options[ch];
// Once you trip the security, you have to roll every time you want to do something
if ((current.security + (alerts)) > 0) {
print_error(_("Password required."));
if (query_bool(_("Hack into system?"))) {
if (!hack_attempt(&(g->u), current.security)) {
activate_random_failure();
shutdown_terminal();
return;
} else {
// Successfully hacked function
options[ch].security = 0;
activate_function(current.action, ch);
}
}
} else { // No need to hack, just activate
activate_function(current.action, ch);
}
reset_terminal();
} // Done processing a selected option.
}
shutdown_terminal(); // This should have been done by now, but just in case.
}
bool computer::hack_attempt(player *p, int Security)
{
if (Security == -1) {
Security = security; // Set to main system security if no value passed
}
const int hack_skill = p->get_skill_level( skill_computer );
// Every time you dig for lab notes, (or, in future, do other suspicious stuff?)
// +2 dice to the system's hack-resistance
// So practical max files from a given terminal = 5, at 10 Computer
if (alerts > 0) {
Security += (alerts * 2);
}
p->moves -= 10 * (5 + Security * 2) / std::max( 1, hack_skill + 1 );
int player_roll = hack_skill;
///\EFFECT_INT <8 randomly penalizes hack attempts, 50% of the time
if (p->int_cur < 8 && one_in(2)) {
player_roll -= rng(0, 8 - p->int_cur);
///\EFFECT_INT >8 randomly benefits hack attempts, 33% of the time
} else if (p->int_cur > 8 && one_in(3)) {
player_roll += rng(0, p->int_cur - 8);
}
///\EFFECT_COMPUTER increases chance of successful hack attempt, vs Security level
bool successful_attempt = (dice(player_roll, 6) >= dice(Security, 6));
p->practice( skill_computer, (successful_attempt ? (15 + Security * 3) : 7));
return successful_attempt;
}
std::string computer::save_data()
{
std::ostringstream data;
std::string savename = name; // Replace " " with "_"
size_t found = savename.find(" ");
while (found != std::string::npos) {
savename.replace(found, 1, "_");
found = savename.find(" ");
}
data << savename << " " << security << " " << mission_id << " " <<
options.size() << " ";
for( auto &elem : options ) {
savename = elem.name;
found = savename.find(" ");
while (found != std::string::npos) {
savename.replace(found, 1, "_");
found = savename.find(" ");
}
data << savename << " " << int( elem.action ) << " " << elem.security << " ";
}
data << failures.size() << " ";
for( auto &elem : failures ) {
data << int( elem ) << " ";
}
return data.str();
}
void computer::load_data(std::string data)
{
options.clear();
failures.clear();
std::stringstream dump;
dump << data;
// Pull in name and security
dump >> name >> security >> mission_id;
size_t found = name.find("_");
while (found != std::string::npos) {
name.replace(found, 1, " ");
found = name.find("_");
}
// Pull in options
int optsize;
dump >> optsize;
for (int n = 0; n < optsize; n++) {
std::string tmpname;
int tmpaction, tmpsec;
dump >> tmpname >> tmpaction >> tmpsec;
size_t tmp_found = tmpname.find("_");
while (tmp_found != std::string::npos) {
tmpname.replace(tmp_found, 1, " ");
tmp_found = tmpname.find("_");
}
add_option(tmpname, computer_action(tmpaction), tmpsec);
}
// Pull in failures
int failsize, tmpfail;
dump >> failsize;
for (int n = 0; n < failsize; n++) {
dump >> tmpfail;
failures.push_back(computer_failure(tmpfail));
}
}
void computer::activate_function(computer_action action, char ch)
{
// Token move cost for any action, if an action takes longer decrement moves further.
g->u.moves -= 30;
switch (action) {
case COMPACT_NULL: // Unknown action.
case NUM_COMPUTER_ACTIONS: // Suppress compiler warning [-Wswitch]
break;
case COMPACT_OPEN:
g->m.translate_radius(t_door_metal_locked, t_floor, 25.0, g->u.pos());
query_any(_("Doors opened. Press any key..."));
break;
//LOCK AND UNLOCK are used to build more complex buildings
// that can have multiple doors that can be locked and be
// unlocked by different computers.
//Simply uses translate_radius which take a given radius and
// player position to determine which terrain tiles to edit.
case COMPACT_LOCK:
g->m.translate_radius(t_door_metal_c, t_door_metal_locked, 8.0, g->u.pos());
query_any(_("Lock enabled. Press any key..."));
break;
case COMPACT_UNLOCK:
g->m.translate_radius(t_door_metal_locked, t_door_metal_c, 8.0, g->u.pos());
query_any(_("Lock disabled. Press any key..."));
break;
//Toll is required for the church computer/mechanism to function
case COMPACT_TOLL:
//~ the sound of a church bell ringing
sounds::sound(g->u.pos(), 120, _("Bohm... Bohm... Bohm..."));
break;
case COMPACT_SAMPLE:
g->u.moves -= 30;
for (int x = 0; x < SEEX * MAPSIZE; x++) {
for (int y = 0; y < SEEY * MAPSIZE; y++) {
if (g->m.ter(x, y) == t_sewage_pump) {
for (int x1 = x - 1; x1 <= x + 1; x1++) {
for (int y1 = y - 1; y1 <= y + 1; y1++ ) {
if (g->m.furn(x1, y1) == f_counter) {
bool found_item = false;
item sewage( "sewage", calendar::turn );
auto candidates = g->m.i_at( x1, y1 );
for( auto candidate = candidates.begin();
candidate !=candidates.end(); ++candidate ) {
long capa = candidate->get_remaining_capacity_for_liquid( sewage );
if( capa <= 0 ) {
continue;
}
item &elem = *candidate;
capa = std::min( sewage.charges, capa );
if( elem.contents.empty() ) {
elem.put_in( sewage );
elem.contents.front().charges = capa;
} else {
elem.contents.front().charges += capa;
}
found_item = true;
break;
}
if (!found_item) {
g->m.add_item_or_charges(x1, y1, sewage);
}
}
}
}
}
}
}
break;
case COMPACT_RELEASE:
g->u.add_memorial_log(pgettext("memorial_male", "Released subspace specimens."),
pgettext("memorial_female", "Released subspace specimens."));
sounds::sound(g->u.pos(), 40, _("an alarm sound!"));
g->m.translate_radius(t_reinforced_glass, t_floor, 25.0, g->u.pos());
query_any(_("Containment shields opened. Press any key..."));
break;
case COMPACT_RELEASE_BIONICS:
sounds::sound(g->u.pos(), 40, _("an alarm sound!"));
g->m.translate_radius(t_reinforced_glass, t_floor, 3.0, g->u.pos());
query_any(_("Containment shields opened. Press any key..."));
break;
case COMPACT_TERMINATE:
g->u.add_memorial_log(pgettext("memorial_male", "Terminated subspace specimens."),
pgettext("memorial_female", "Terminated subspace specimens."));
for (int x = 0; x < SEEX * MAPSIZE; x++) {
for (int y = 0; y < SEEY * MAPSIZE; y++) {
tripoint p( x, y, g->u.posz() );
int mondex = g->mon_at( p );
if (mondex != -1 &&
((g->m.ter(x, y - 1) == t_reinforced_glass &&
g->m.ter(x, y + 1) == t_concrete_wall) ||
(g->m.ter(x, y + 1) == t_reinforced_glass &&
g->m.ter(x, y - 1) == t_concrete_wall))) {
g->zombie( mondex ).die( &g->u );
}
}
}
query_any(_("Subjects terminated. Press any key..."));
break;
case COMPACT_PORTAL: {
g->u.add_memorial_log(pgettext("memorial_male", "Opened a portal."),
pgettext("memorial_female", "Opened a portal."));
tripoint tmp = g->u.pos();
int &i = tmp.x;
int &j = tmp.y;
for( i = 0; i < SEEX * MAPSIZE; i++ ) {
for( j = 0; j < SEEY * MAPSIZE; j++ ) {
int numtowers = 0;
tripoint tmp2 = tmp;
int &xt = tmp2.x;
int &yt = tmp2.y;
for( xt = i - 2; xt <= i + 2; xt++ ) {
for( yt = j - 2; yt <= j + 2; yt++ ) {
if (g->m.ter( tmp2 ) == t_radio_tower) {
numtowers++;
}
}
}
if( numtowers >= 4 ) {
if (g->m.tr_at( tmp ).id == trap_str_id( "tr_portal" )) {
g->m.remove_trap( tmp );
} else {
g->m.add_trap( tmp, tr_portal );
}
}
}
}
}
break;
case COMPACT_CASCADE: {
if (!query_bool(_("WARNING: Resonance cascade carries severe risk! Continue?"))) {
return;
}
g->u.add_memorial_log(pgettext("memorial_male", "Caused a resonance cascade."),
pgettext("memorial_female", "Caused a resonance cascade."));
std::vector<tripoint> cascade_points;
for (int i = g->u.posx() - 10; i <= g->u.posx() + 10; i++) {
for (int j = g->u.posy() - 10; j <= g->u.posy() + 10; j++) {
if (g->m.ter(i, j) == t_radio_tower) {
// TODO: Z
cascade_points.push_back( tripoint(i, j, g->get_levz() ) );
}
}
}
g->resonance_cascade( random_entry( cascade_points, g->u.pos() ) );
}
break;
case COMPACT_RESEARCH: {
// TODO: seed should probably be a member of the computer, or better: of the computer action.
// It is here to ensure one computer reporting the same text on each invocation.
const int seed = g->get_levx() + g->get_levy() + g->get_levz() + alerts;
std::string log = SNIPPET.get( SNIPPET.assign( "lab_notes", seed ) );
if( log.empty() ) {
log = _("No data found.");
} else {
g->u.moves -= 70;
}
print_text("%s", log.c_str());
// One's an anomaly
if (alerts == 0) {
query_any(_("Local data-access error logged, alerting helpdesk. Press any key..."));
alerts ++;
} else {
// Two's a trend.
query_any(_("Warning: anomalous archive-access activity detected at this node. Press any key..."));
alerts ++;
}
}
break;
case COMPACT_MAPS: {
g->u.moves -= 30;
const tripoint center = g->u.global_omt_location();
overmap_buffer.reveal(point(center.x, center.y), 40, 0);
query_any(_("Surface map data downloaded. Local anomalous-access error logged. Press any key..."));
remove_option( COMPACT_MAPS );
alerts ++;
}
break;
case COMPACT_MAP_SEWER: {
g->u.moves -= 30;
const tripoint center = g->u.global_omt_location();
for (int i = -60; i <= 60; i++) {
for (int j = -60; j <= 60; j++) {
const oter_id &oter = overmap_buffer.ter(center.x + i, center.y + j, center.z);
if (is_ot_type("sewer", oter) || is_ot_type("sewage", oter)) {
overmap_buffer.set_seen(center.x + i, center.y + j, center.z, true);
}
}
}
query_any(_("Sewage map data downloaded. Press any key..."));
remove_option( COMPACT_MAP_SEWER );
}
break;
case COMPACT_MISS_LAUNCH: {
// Target Acquisition.
tripoint target = overmap::draw_overmap(0);
if (target == overmap::invalid_tripoint) {
add_msg(m_info, _("Target acquisition canceled"));
return;
}
if(query_yn(_("Confirm nuclear missile launch."))) {
add_msg(m_info, _("Nuclear missile launched!"));
options.clear();//Remove the option to fire another missile.
} else {
add_msg(m_info, _("Nuclear missile launch aborted."));
return;
}
g->refresh_all();
//Put some smoke gas and explosions at the nuke location.
for(int i = g->u.posx() + 8; i < g->u.posx() + 15; i++) {
for(int j = g->u.posy() + 3; j < g->u.posy() + 12; j++)
if(!one_in(4)) {
tripoint dest( i + rng(-2, 2), j + rng(-2, 2), g->u.posz() );
g->m.add_field( dest, fd_smoke, rng(1, 9), 0 );
}
}
g->explosion( tripoint( g->u.posx() + 10, g->u.posx() + 21, g->get_levz() ), 200, 0.7, true ); //Only explode once. But make it large.
//...ERASE MISSILE, OPEN SILO, DISABLE COMPUTER
// For each level between here and the surface, remove the missile
for (int level = g->get_levz(); level <= 0; level++) {
map tmpmap;
tmpmap.load(g->get_levx(), g->get_levy(), level, false);
if(level < 0) {
tmpmap.translate(t_missile, t_hole);
} else if(level == 0) {
tmpmap.translate(t_metal_floor, t_hole);
}
tmpmap.save();
}
const oter_id oter = overmap_buffer.ter(target.x, target.y, 0);
//~ %s is terrain name
g->u.add_memorial_log( pgettext("memorial_male", "Launched a nuke at a %s."),
pgettext("memorial_female", "Launched a nuke at a %s."),
oter->get_name().c_str() );
for(int x = target.x - 2; x <= target.x + 2; x++) {
for(int y = target.y - 2; y <= target.y + 2; y++) {
// give it a nice rounded shape
if(!(x == (target.x - 2) && (y == (target.y - 2))) &&
!(x == (target.x - 2) && (y == (target.y + 2))) &&
!(x == (target.x + 2) && (y == (target.y - 2))) &&
!(x == (target.x + 2) && (y == (target.y + 2)))) {
// TODO: Z
g->nuke( tripoint( x, y, 0 ) );
}
}
}
activate_failure(COMPFAIL_SHUTDOWN);
}
break;
case COMPACT_MISS_DISARM: // TODO: stop the nuke from creating radioactive clouds.
if(query_yn(_("Disarm missile."))) {
g->u.add_memorial_log(pgettext("memorial_male", "Disarmed a nuclear missile."),
pgettext("memorial_female", "Disarmed a nuclear missile."));
add_msg(m_info, _("Nuclear missile disarmed!"));
options.clear();//disable missile.
activate_failure(COMPFAIL_SHUTDOWN);
} else {
add_msg(m_neutral, _("Nuclear missile remains active."));
return;
}
break;
case COMPACT_LIST_BIONICS: {
g->u.moves -= 30;
std::vector<std::string> names;
int more = 0;
for (int x = 0; x < SEEX * MAPSIZE; x++) {
for (int y = 0; y < SEEY * MAPSIZE; y++) {
for( auto &elem : g->m.i_at( x, y ) ) {
if( elem.is_bionic() ) {
if ((int)names.size() < TERMY - 8) {
names.push_back( elem.tname() );
} else {
more++;
}
}
}
}
}
reset_terminal();
print_newline();
print_line(_("Bionic access - Manifest:"));
print_newline();
for( auto &name : names ) {
print_line( "%s", name.c_str() );
}
if (more > 0) {
print_line(ngettext("%d OTHER FOUND...", "%d OTHERS FOUND...", more), more);
}
print_newline();
query_any(_("Press any key..."));
}
break;
case COMPACT_ELEVATOR_ON:
for (int x = 0; x < SEEX * MAPSIZE; x++) {
for (int y = 0; y < SEEY * MAPSIZE; y++) {
if (g->m.ter(x, y) == t_elevator_control_off) {
g->m.ter_set(x, y, t_elevator_control);
}
}
}
query_any(_("Elevator activated. Press any key..."));
break;
case COMPACT_AMIGARA_LOG: // TODO: This is static, move to data file?
g->u.moves -= 30;
reset_terminal();
print_line(_("NEPower Mine(%d:%d) Log"), g->get_levx(), g->get_levy());
print_line(_("\
ENTRY 47:\n\
Our normal mining routine has unearthed a hollow chamber. This would not be\n\
out of the ordinary, save for the odd, perfectly vertical faultline found.\n\
This faultline has several odd concavities in it which have the more\n\
superstitious crew members alarmed; they seem to be of human origin.\n\
\n\
ENTRY 48:\n\
The concavities are between 10 and 20 feet tall, and run the length of the\n\
faultline. Each one is vaguely human in shape, but with the proportions of\n\
the limbs, neck and head greatly distended, all twisted and curled in on\n\
themselves.\n"));
if (!query_bool(_("Continue reading?"))) {
return;
}
g->u.moves -= 30;
reset_terminal();
print_line(_("NEPower Mine(%d:%d) Log"), g->get_levx(), g->get_levy());
print_line(_("\
ENTRY 49:\n\
We've stopped mining operations in this area, obviously, until archaeologists\n\
have the chance to inspect the area. This is going to set our schedule back\n\
by at least a week. This stupid artifact-preservation law has been in place\n\
for 50 years, and hasn't even been up for termination despite the fact that\n\
these mining operations are the backbone of our economy.\n\
\n\
ENTRY 52:\n\
Still waiting on the archaeologists. We've done a little light inspection of\n\
the faultline; our sounding equipment is insufficient to measure the depth of\n\
the concavities. The equipment is rated at 15 miles depth, but it isn't made\n\
for such narrow tunnels, so it's hard to say exactly how far back they go.\n"));
if (!query_bool(_("Continue reading?"))) {
return;
}
g->u.moves -= 30;
reset_terminal();
print_line(_("NEPower Mine(%d:%d) Log"), g->get_levx(), g->get_levy());
print_line(_("\
ENTRY 54:\n\
I noticed a couple of the guys down in the chamber with a chisel, breaking\n\
off a piece of the sheer wall. I'm looking the other way. It's not like\n\
the eggheads are going to notice a little piece missing. Fuck em.\n\
\n\
ENTRY 55:\n\
Well, the archaeologists are down there now with a couple of the boys as\n\
guides. They're hardly Indiana Jones types; I doubt they been below 20\n\
feet. I hate taking guys off assignment just to babysit the scientists, but\n\
if they get hurt we'll be shut down for god knows how long.\n\
\n\
ENTRY 58:\n\
They're bringing in ANOTHER CREW? Christ, it's just some cave carvings! I\n\
know that's sort of a big deal, but come on, these guys can't handle it?\n"));
if (!query_bool(_("Continue reading?"))) {
return;
}
reset_terminal();
for (int i = 0; i < 10; i++) {
print_gibberish_line();
}
print_newline();
print_newline();
print_newline();
print_line(_("AMIGARA PROJECT"));
print_newline();
print_newline();
if (!query_bool(_("Continue reading?"))) {
return;
}
g->u.moves -= 30;
reset_terminal();
print_line(_("\
SITE %d%d%d\n\
PERTINANT FOREMAN LOGS WILL BE PREPENDED TO NOTES"),
g->get_levx(), g->get_levy(), abs(g->get_levz()));
print_line(_("\n\
MINE OPERATIONS SUSPENDED; CONTROL TRANSFERRED TO AMIGARA PROJECT UNDER\n\
IMPERATIVE 2:07B\n\
FAULTLINE SOUNDING HAS PLACED DEPTH AT 30.09 KM\n\
DAMAGE TO FAULTLINE DISCOVERED; NEPOWER MINE CREW PLACED UNDER ARREST FOR\n\
VIOLATION OF REGULATION 87.08 AND TRANSFERRED TO LAB 89-C FOR USE AS\n\
SUBJECTS\n\
QUALITIY OF FAULTLINE NOT COMPROMISED\n\
INITIATING STANDARD TREMOR TEST..."));
print_gibberish_line();
print_gibberish_line();
print_newline();
print_error(_("FILE CORRUPTED, PRESS ANY KEY..."));
inp_mngr.wait_for_any_key();
reset_terminal();
break;
case COMPACT_AMIGARA_START:
g->add_event(EVENT_AMIGARA, int(calendar::turn) + 10);
if (!g->u.has_artifact_with(AEP_PSYSHIELD)) {
g->u.add_effect( effect_amigara, 20);
}
// Disable this action to prevent further amigara events, which would lead to
// further amigara monster, which would lead to further artifacts.
remove_option( COMPACT_AMIGARA_START );
break;
case COMPACT_STEMCELL_TREATMENT:
g->u.moves -= 70;
g->u.add_effect( effect_stemcell_treatment, 120);
print_line(_("The machine injects your eyeball with the solution \n\
of pureed bone & LSD."));
query_any(_("Press any key..."));
g->u.mod_pain( rng(40, 90) );
break;
case COMPACT_COMPLETE_MISSION:
for( auto miss : g->u.get_active_missions() ) {
if (miss->name() == options[ch].name){
print_error(_("--ACCESS GRANTED--"));
print_error(_("Mission Complete!"));
miss->step_complete( 1 );
inp_mngr.wait_for_any_key();
return;
//break;
}
}
print_error(_("ACCESS DENIED"));
inp_mngr.wait_for_any_key();
break;
case COMPACT_REPEATER_MOD:
if (g->u.has_amount("radio_repeater_mod", 1)) {
for( auto miss : g->u.get_active_missions() ) {
static const mission_type_id commo_3 = mission_type_id("MISSION_OLD_GUARD_NEC_COMMO_3"),
commo_4 = mission_type_id("MISSION_OLD_GUARD_NEC_COMMO_4");
if (miss->mission_id() == commo_3 || miss->mission_id() == commo_4) {
miss->step_complete( 1 );
print_error(_("Repeater mod installed..."));
print_error(_("Mission Complete!"));
g->u.use_amount("radio_repeater_mod", 1);
inp_mngr.wait_for_any_key();
options.clear();
activate_failure(COMPFAIL_SHUTDOWN);
break;
}
}
}else{
print_error(_("You do not have a repeater mod to install..."));
inp_mngr.wait_for_any_key();
break;
}
break;
case COMPACT_DOWNLOAD_SOFTWARE:
if (!g->u.has_amount("usb_drive", 1)) {
print_error(_("USB drive required!"));
} else {
mission *miss = mission::find(mission_id);
if (miss == NULL) {
debugmsg(_("Computer couldn't find its mission!"));
return;
}
g->u.moves -= 30;
item software(miss->get_item_id(), 0);
software.mission_id = mission_id;
item *usb = g->u.pick_usb();
usb->contents.clear();
usb->put_in(software);
print_line(_("Software downloaded."));
}
inp_mngr.wait_for_any_key();
break;
case COMPACT_BLOOD_ANAL:
g->u.moves -= 70;
for (int x = g->u.posx() - 2; x <= g->u.posx() + 2; x++) {
for (int y = g->u.posy() - 2; y <= g->u.posy() + 2; y++) {
if (g->m.ter(x, y) == t_centrifuge) {
if (g->m.i_at(x, y).empty()) {
print_error(_("ERROR: Please place sample in centrifuge."));
} else if (g->m.i_at(x, y).size() > 1) {
print_error(_("ERROR: Please remove all but one sample from centrifuge."));
} else if (g->m.i_at(x, y)[0].typeId() != "vacutainer") {
print_error(_("ERROR: Please use vacutainer-contained samples."));
} else if (g->m.i_at(x, y)[0].contents.empty()) {
print_error(_("ERROR: Vacutainer empty."));
} else if (g->m.i_at(x, y)[0].contents.front().typeId() != "blood") {
print_error(_("ERROR: Please only use blood samples."));
} else { // Success!
const item &blood = g->m.i_at(x, y).front().contents.front();
const mtype *mt = blood.get_mtype();
if( mt == nullptr || mt->id == mtype_id::NULL_ID() ) {
print_line(_("Result: Human blood, no pathogens found."));
} else if( mt->in_species( ZOMBIE ) ) {
if( mt->sym == "Z" ) {
print_line(_("Result: Human blood. Unknown pathogen found."));
} else {
print_line(_("Result: Unknown blood type. Unknown pathogen found."));
}
print_line(_("Pathogen bonded to erythrocytes and leukocytes."));
if (query_bool(_("Download data?"))) {
if (!g->u.has_amount("usb_drive", 1)) {
print_error(_("USB drive required!"));
} else {
item software("software_blood_data", 0);
item *usb = g->u.pick_usb();
usb->contents.clear();
usb->put_in(software);
print_line(_("Software downloaded."));
}
}
} else {
print_line(_("Result: Unknown blood type. Test nonconclusive."));
}
}
}
}
}
query_any(_("Press any key..."));
break;
case COMPACT_DATA_ANAL:
g->u.moves -= 30;
for (int x = g->u.posx() - 2; x <= g->u.posx() + 2; x++) {
for (int y = g->u.posy() - 2; y <= g->u.posy() + 2; y++) {
if (g->m.ter(x, y) == t_floor_blue) {
print_error(_("PROCESSING DATA"));
if (g->m.i_at(x, y).empty()) {
print_error(_("ERROR: Please place memory bank in scan area."));
} else if (g->m.i_at(x, y).size() > 1) {
print_error(_("ERROR: Please only scan one item at a time."));
} else if (g->m.i_at(x, y)[0].typeId() != "usb_drive" &&
g->m.i_at(x, y)[0].typeId() != "black_box") {
print_error(_("ERROR: Memory bank destroyed or not present."));
} else if (g->m.i_at(x, y)[0].typeId() == "usb_drive" && g->m.i_at(x, y)[0].contents.empty()) {
print_error(_("ERROR: Memory bank is empty."));
} else { // Success!
if (g->m.i_at(x, y)[0].typeId() == "black_box") {
print_line(_("Memory Bank: Military Hexron Encryption\nPrinting Transcript\n"));
item transcript("black_box_transcript", calendar::turn);
g->m.add_item_or_charges(g->u.posx(), g->u.posy(), transcript);
} else {
print_line(_("Memory Bank: Unencrypted\nNothing of interest.\n"));
}
}
}
}
}
query_any(_("Press any key..."));
break;
case COMPACT_DISCONNECT:
reset_terminal();
print_line(_("\n\
ERROR: NETWORK DISCONNECT \n\
UNABLE TO REACH NETWORK ROUTER OR PROXY. PLEASE CONTACT YOUR\n\
SYSTEM ADMINISTRATOR TO RESOLVE THIS ISSUE.\n\
\n"));
query_any(_("Press any key to continue..."));
break;
case COMPACT_EMERG_MESS:
print_line(_("\
GREETINGS CITIZEN. A BIOLOGICAL ATTACK HAS TAKEN PLACE AND A STATE OF \n\
EMERGENCY HAS BEEN DECLARED. EMERGENCY PERSONNEL WILL BE AIDING YOU \n\
SHORTLY. TO ENSURE YOUR SAFETY PLEASE FOLLOW THE BELOW STEPS. \n\
\n\
1. DO NOT PANIC. \n\
2. REMAIN INSIDE THE BUILDING. \n\
3. SEEK SHELTER IN THE BASEMENT. \n\
4. USE PROVIDED GAS MASKS. \n\
5. AWAIT FURTHER INSTRUCTIONS \n\
\n\
\n"));
query_any(_("Press any key to continue..."));
break;
case COMPACT_EMERG_REF_CENTER:
reset_terminal();
mark_refugee_center();
reset_terminal();
break;
case COMPACT_TOWER_UNRESPONSIVE:
print_line(_("\
WARNING, RADIO TOWER IS UNRESPONSIVE. \n\
\n\
BACKUP POWER INSUFFICIENT TO MEET BROADCASTING REQUIREMENTS. \n\
IN THE EVENT OF AN EMERGENCY, CONTACT LOCAL NATIONAL GUARD \n\
UNITS TO RECEIVE PRIORITY WHEN GENERATORS ARE BEING DEPLOYED. \n\
\n\
\n"));
query_any(_("Press any key to continue..."));
break;
case COMPACT_SR1_MESS:
reset_terminal();
print_line(_("\n\
Subj: Security Reminder\n\
To: all SRCF staff\n\
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
\n\
I want to remind everyone on staff: Do not open or examine\n\
containers above your security-clearance. If you have some\n\
question about safety protocols or shipping procedures, please\n\
contact your SRCF administrator or on-site military officer.\n\
When in doubt, assume all containers are Class-A Biohazards\n\
and highly toxic. Take full precautions!\n\
\n"));
query_any(_("Press any key to continue..."));
break;
case COMPACT_SR2_MESS:
reset_terminal();
print_line(_("\n\
Subj: Security Reminder\n\
To: all SRCF staff\n\
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
\n\
From today onward medical wastes are not to be stored anywhere\n\
near radioactive materials. All containers are to be\n\
re-arranged according to these new regulations. If your\n\
facility currently has these containers stored in close\n\
proximity, you are to work with armed guards on duty at all\n\
times. Report any unusual activity to your SRCF administrator\n\
at once.\n\
"));
query_any(_("Press any key to continue..."));
break;
case COMPACT_SR3_MESS:
reset_terminal();
print_line(_("\n\
Subj: Security Reminder\n\
To: all SRCF staff\n\
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
\n\
Worker health and safety is our number one concern! As such,\n\
we are instituting weekly health examinations for all SRCF\n\
employees. Report any unusual symptoms or physical changes\n\
to your SRCF administrator at once.\n\
"));
query_any(_("Press any key to continue..."));
break;
case COMPACT_SR4_MESS:
reset_terminal();
print_line(_("\n\
Subj: Security Reminder\n\
To: all SRCF staff\n\
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
\n\
All compromised facilities will remain under lock down until\n\
further notice. Anyone who has seen or come in direct contact\n\
with the creatures is to report to the home office for a full\n\
medical evaluation and security debriefing.\n\
"));
query_any(_("Press any key to continue..."));
break;
case COMPACT_SRCF_1_MESS:
reset_terminal();
print_line(_("\n\
Subj: EPA: Report All Potential Containment Breaches 3873643\n\
To: all SRCF staff\n\
From: Robert Shane, Director of the EPA\n\