-
Notifications
You must be signed in to change notification settings - Fork 0
/
briefing.c
2715 lines (2238 loc) · 72.5 KB
/
briefing.c
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 <string.h>
#include <math.h>
#include "config.h"
#include "allegro.h"
#include "globvars.h"
#include "palette.h"
#include "game.h"
#include "input.h"
#include "display.h"
#include "sound.h"
#include "menu.h"
#include "briefing.h"
#include "stuff.h"
#include "text.h"
#define TRANS_MODE drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0);
#define END_TRANS_MODE drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0);
#define END_TRANS drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0);
#define FREQ_BSELECT 1200
#define FREQ_BSELECT1 (FREQ_BSELECT * 1.05946 * 1.05946 * 1.05946 * 1.05946)
#define FREQ_BSELECT2 (FREQ_BSELECT * 1.05946 * 1.05946)
#define VOL_BSELECT 100
#define VOL_BSELECT1 100
extern RGB palet [256];
extern volatile unsigned char ticked;
extern BITMAP *display [3];
extern FONT* small_font;
//extern int message_lines;
BITMAP* bsprite [2] [BSPRITES] [2];
BITMAP* wisprite [WISPRITES];
unsigned char briefing_counter;
char bkey_wait [2];
int bkey_wait_pressed [2];
struct linestruct bline [LINES];
void bdisplay(void);
void run_bconvoys(void);
int check_settled(void);
void check_for_fire(void);
void run_bscripts(void);
int briefing_over_menu(void);
int briefing_loop(void);
void boverdisplay(void);
int pressing_a_key(int p, int ckeyp, int cbuttonp);
int get_bsprite(int type);
int get_bsprite_from_ship(int type);
char ask_bover_quit(void);
int choose_weapons(void);
void choose_display(int finished1, int finished2);
void weapon_text(int x, int y, int w, int w2);
void draw_arrows(int x, int y, int w, int basecol, int counter);
void weapon_box(int p, int msg, int x, int y, int x1, int y1, int line_dir);
void run_tbox(void);
void draw_tbox(void);
void create_tbox(int msg, int x, int y, int w, int x2, int y2, int cv);
void report_text(int y);
int loss_proportion(int a);
int ship_value(int type);
int get_rank(int lost, int r2, int r3, int r4, int r5);
#define BSHIPS 50
#define BSELECT 10
#define MENU_SENSE 100
#define BOX_W 160
enum
{
BSHIP_NONE,
BSHIP_OLD2,
BSHIP_OLD3,
BSHIP_FRIEND3,
BSHIP_FIGHTER_FRIEND,
BSHIP_MOTH,
BSHIP_END_FRIENDS,
BSHIP_FIGHTER,
BSHIP_SCOUT2,
BSHIP_BOMBER,
BSHIP_SCOUT3,
BSHIP_ESCOUT,
BSHIP_SCOUTCAR,
BSHIP_EBASE,
BSHIP_EINT,
NO_BSHIP_TYPES
};
enum
{BCONVOY_0, BCONVOY_1, BCONVOY_2,BCONVOY_3,BCONVOY_4,BCONVOY_5,BCONVOY_6,BCONVOY_7,BCONVOY_8,BCONVOYS};
struct bshipstruct
{
int type;
int side;
int convoy;
int x, y;
};
struct bconvoystruct
{
int exists;
int x;
int y;
int face;
int x_speed;
int y_speed;
int goal_x;
int goal_y;
int move_settle;
};
struct bselectstruct
{
int exists;
int x;
int y;
int x1, y1, x2, y2;
int x_offset, y_offset;
int count;
};
struct bshipstruct bship [BSHIPS];
struct bconvoystruct bconvoy [BCONVOYS];
struct bselectstruct bselect [BSELECT];
enum
{
BSCRIPT_HEADER,
BSCRIPT_NEW_SHIP,
BSCRIPT_NEW_CONVOY,
BSCRIPT_MOVE,
BSCRIPT_WAIT,
BSCRIPT_HIT_FIRE,
BSCRIPT_BMESSAGE,
BSCRIPT_SETTLE,
BSCRIPT_SELECT,
BSCRIPT_CLEAR_MESSAGE,
BSCRIPT_END
};
#define BVARS 8
#define LEFT 0
#define RIGHT 1
enum
{
BNEWSHIP_BCONVOY,
BNEWSHIP_TYPE,
BNEWSHIP_X,
BNEWSHIP_Y
};
enum
{
BNEWCONVOY_CONVOY,
BNEWCONVOY_X,
BNEWCONVOY_Y,
BNEWCONVOY_FACE
};
enum
{
BMOVE_CONVOY,
BMOVE_WAIT,
BMOVE_X,
BMOVE_Y,
BMOVE_SPEED,
BMOVE_FACE,
BMOVE_SETTLE
};
enum
{
BSELECT_CONVOY,
BSELECT_X_OFFSET,
BSELECT_Y_OFFSET
};
enum
{
BWAIT_TIME
};
enum
{
BMESSAGE_BMESSAGE,
BMESSAGE_X,
BMESSAGE_Y,
BMESSAGE_W,
BMESSAGE_X2,
BMESSAGE_Y2,
BMESSAGE_CONVOY
};
// BOX_W - 10
int tbox_exists;
int tbox_x;
int tbox_y;
int tbox_x2;
int tbox_y2;
int tbox_w;
int tbox_h;
int tbox_in;
int tbox_flash_in;
int tbox_out;
int tbox_flash_out;
struct briefingscript
{
int type;
int var [BVARS];
};
enum
{
BMSG_CANNON,
BMSG_FIGHTER,
BMSG_WPN1,
BMSG_WPN2,
BMSG_WPN3,
BMSG_WPN4,
BMSG_WPN5,
BMSG_WPN6,
BMSG_WPN7,
BMSG_M1_1,
BMSG_M1_2,
BMSG_M1_3,
BMSG_M1_4,
BMSG_M1_5,
BMSG_M1_6,
BMSG_M2_1,
BMSG_M2_2,
BMSG_M2_3,
BMSG_M2_4,
BMSG_M2_5,
BMSG_M2_6,
BMSG_M2_7,
BMSG_M2_8,
BMSG_M3_1,
BMSG_M3_2,
BMSG_M3_3,
BMSG_M3_4,
BMSG_M3_5,
BMSG_M3_6,
BMSG_M3_7,
BMSG_M3_8,
BMSGS
};
struct msgstruct bmsg [BMSGS] =
{
{" >> double autocannon $P $BPower: $C3.0 (x2) $PA basic fighter weapon. ", {0}},
{" >> fighter $PStandard OCSF fighter. Has good armour and shielding and a powerful engine, but lacks the agility or firepower of the Angry Moth. Armed with double autocannon. ", {0}},
{" >> anti-fighter missile $P $BPower: $C40.0 $PHigh-performance seeking missile with a sensor system capable of targetting small craft in a forward arc. Full lock-on maximises tracking capability. Low rate of fire. ", {0}},
{" >> anti-warship missile $P $BPower: $C50.0 $PSlow missile with limited homing capability. Capable of targetting large ships only. Warhead is ineffective until missile drive fully engaged. ", {0}},
{" >> multi-rockets $P $BPower: $C32.0 $PRocket launcher capable of loading and unleashing a stream of small rockets. ", {0}},
{" >> torpedo $P $BPower: $C180.0 $PPowerful, but difficult to aim. Warhead is unstable and must prime both before and after launch - the torpedo will cause little harm if it explodes too early. ", {0}},
{" >> single rocket $P $BPower: $C32.0 $PFires a single rocket. Lacks the rapid fire of the multiple rocket launcher but does not require pre-loading. ", {0}},
{" >> tracking cannon $P $BPower: $C3.0 $PModifies the standard autocannons with electromagnets capable of deflecting fire towards targets within a narrow forward arc. ", {0}},
{" >> heavy cannon $P $BPower: $C10.0 (x2) $PIncreases the power of the standard autocannons, at the cost of speed and rate of fire. ", {0}},
// {" $BAngry Moth 1 $Cleads a strike squadron to engage with any stragglers. ", {0}},
{"Our deep tracking array at SK-9 has picked up a small raiding party which seems to have slipped past our outer defences. $P $P Most likely it is on its way to strike at our internal freight networks. ", {0}},
{"We are scrambling a small interdiction force to catch the raiders while they recharge in low orbit around RL-3. $P $P $B Alpha group $C consists of four light cruisers with fighter escort. ", {0}},
{" $BAngry Moth $Cleads a strike squadron to engage with any stragglers. ", {0}},
{"The precise size and composition of the enemy force is unknown, but we expect only small warships and standard fighters. ", {0}},
{" $BAlpha group $Ccaptain has command in this engagement. ", {0}},
{"Get as many of them as you can before they jump out! $P $P>> $BBriefing end$C ", {0}},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
{""},
{"Analysis of enemy fleet movements suggests the presence of an enemy outpost in the RO system. $P $P Our interstellar sensors have trouble detecting it directly, but we believe we have located a base in orbit around RO-2. ", {0}},
{"Destroying this base would severely hamper the enemy's offensive in this sector. ", {0}},
{" ", {0}},
{"We can expect the base to be very heavily armed and shielded. It is also likely to be defended by large numbers of smaller ships. ", {0}},
{" $BAlpha group $Cwill jump in and approach the base in an attempt to draw some of the defenders away. ", {0}},
{" $BAngry Moth $Cwill join $BAlpha group's $Cdecoy attack. ", {0}},
{" $BBeta Group $Cwill jump in about five minutes after $BAlpha group$C. $BAngry Moth $Cis to assist in the attack on the base. Hopefully you will have a clear run! ", {0}},
{"Look out for enemy reinforcements! $P $P>> $BBriefing end$C ", {0}},
// remember trailing space!!
};
#define BSCRIPTS 300
struct briefingscript bscript [BSCRIPTS] =
{
{BSCRIPT_HEADER, {1}},
// {BSCRIPT_BMESSAGE, {BMSG_M1_1, }}, // must always have a message - preferably straight after header
// {BSCRIPT_HIT_FIRE},
// {BSCRIPT_WAIT, {50}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_2, 350, 250, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_SCOUT2, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_FIGHTER, -5, -5}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_FIGHTER, -5, 5}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_3, 350, 200, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUT2, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_FIGHTER, -5, -5}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_FIGHTER, -5, 5}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_4, 350, 300, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_SCOUT2, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_FIGHTER, -5, -5}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_FIGHTER, -5, 5}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_5, 300, 225, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_SCOUT2, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_FIGHTER, -5, -5}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_FIGHTER, -5, 5}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_6, 300, 275, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_6, BSHIP_SCOUT2, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_6, BSHIP_FIGHTER, -5, -5}},
{BSCRIPT_NEW_SHIP, {BCONVOY_6, BSHIP_FIGHTER, -5, 5}},
{BSCRIPT_BMESSAGE, {BMSG_M1_1, 150, 150, BOX_W + 10, 330, 260, -1}},
{BSCRIPT_SELECT, {BCONVOY_2, 0, 0}},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_SELECT, {BCONVOY_3, 0, 0}},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_SELECT, {BCONVOY_4, 0, 0}},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_SELECT, {BCONVOY_5, 0, 0}},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_SELECT, {BCONVOY_6, 0, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_NEW_CONVOY, {BCONVOY_0, 50, 250, RIGHT}},
{BSCRIPT_BMESSAGE, {BMSG_M1_2, 150, 450, BOX_W + 10, 0, 29, BCONVOY_0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -10, -7}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -10, 7}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -20, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -2, -6}},
// {BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -20, -14}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -2, 6}},
// {BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -20, 14}},
/* {BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -15, -15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -15, 15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -5, -15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -5, 15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -25, -25}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -25, 25}},*/
{BSCRIPT_SELECT, {BCONVOY_0, 0, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_NEW_CONVOY, {BCONVOY_1, 70, 210, RIGHT}},
{BSCRIPT_BMESSAGE, {BMSG_M1_3, 150, 450, BOX_W + 10, 5, 22, BCONVOY_1}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_MOTH, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_FIGHTER_FRIEND, -5, -5}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_FIGHTER_FRIEND, -5, 5}},
{BSCRIPT_SELECT, {BCONVOY_1, 0, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M1_4, 150, 150, BOX_W + 10, 330, 250, -1}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M1_5, 150, 150, BOX_W + 10, 0, 0, -2}},
{BSCRIPT_MOVE, {BCONVOY_0, 0, 260, 250, 3000, RIGHT, 1}},
{BSCRIPT_MOVE, {BCONVOY_1, 0, 280, 210, 3000, RIGHT, 0}},
{BSCRIPT_MOVE, {BCONVOY_2, 0, 550, 250, 1500, RIGHT, 0}},
{BSCRIPT_MOVE, {BCONVOY_3, 0, 550, 200, 1500, RIGHT, 0}},
{BSCRIPT_MOVE, {BCONVOY_4, 0, 550, 300, 1500, RIGHT, 0}},
{BSCRIPT_MOVE, {BCONVOY_5, 0, 550, 225, 1500, RIGHT, 0}},
{BSCRIPT_MOVE, {BCONVOY_6, 0, 550, 275, 1500, RIGHT, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M1_6, 150, 150, BOX_W + 10, 0, 0, -2}},
{BSCRIPT_WAIT, {100}},
{BSCRIPT_END},
{BSCRIPT_HEADER, {2}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_3, 305, 280, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_EBASE, 0, 0}},
{BSCRIPT_BMESSAGE, {BMSG_M2_1, 500, 420, BOX_W + 10, 20, 11, BCONVOY_3}},
{BSCRIPT_SELECT, {BCONVOY_3, 0, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M2_2, 120, 420, BOX_W + 10, 20, 11, -2}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M2_3, 500, 420, BOX_W + 10, 20, 11, BCONVOY_3}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUT2, 40, -40}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUT2, -40, -40}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUT2, -70, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUT2, 70, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUT2, -40, 40}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUT2, 40, 40}},
{BSCRIPT_SELECT, {BCONVOY_3, 0, 0}},
{BSCRIPT_BMESSAGE, {BMSG_M2_4, 120, 420, BOX_W + 10, -80, 11, BCONVOY_3}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M2_5, 500, 420, BOX_W + 10, 20, 11, -2}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M2_6, 120, 220, BOX_W + 10, 20, 11, -2}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_0, 130, 450, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD3, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -10, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -10, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, 10, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, 10, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -17, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -2, -6}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -2, 6}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_1, 210, 50, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD3, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, -10, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, -10, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, 10, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, 10, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, -17, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_FIGHTER_FRIEND, -2, -6}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_FIGHTER_FRIEND, -2, 6}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_2, 540, 330, LEFT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_OLD3, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_OLD2, -10, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_OLD2, -10, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_OLD2, 10, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_OLD2, 10, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_OLD2, -17, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_FIGHTER_FRIEND, -2, -6}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_FIGHTER_FRIEND, -2, 6}},
{BSCRIPT_SELECT, {BCONVOY_0, 0, 0}},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_SELECT, {BCONVOY_1, 0, 0}},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_SELECT, {BCONVOY_2, 0, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M2_7, 330, 480, BOX_W + 10, 40, -1, BCONVOY_0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_MOTH, 25, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, 20, -15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, 20, -5}},
{BSCRIPT_SELECT, {BCONVOY_0, 0, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_BMESSAGE, {BMSG_M2_8, 500, 170, BOX_W + 10, 0, 29, -2}},
{BSCRIPT_MOVE, {BCONVOY_0, 0, 250, 380, 3000, RIGHT, 1}},
{BSCRIPT_MOVE, {BCONVOY_1, 0, 310, 190, 3000, RIGHT, 1}},
{BSCRIPT_MOVE, {BCONVOY_2, 0, 410, 300, 3000, LEFT, 1}},
{BSCRIPT_SETTLE},
{BSCRIPT_END},
{BSCRIPT_HEADER, {3}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_3, 305, 280, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_EBASE, 0, 0}},
{BSCRIPT_BMESSAGE, {BMSG_M3_1, 500, 420, BOX_W + 10, 20, 11, BCONVOY_3}},
{BSCRIPT_SELECT, {BCONVOY_3, 0, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_CLEAR_MESSAGE},
{BSCRIPT_BMESSAGE, {BMSG_M3_2, 120, 420, BOX_W + 10, 20, 11, -2}},
// {BSCRIPT_BMESSAGE, {BMSG_M3_2, 500, 420, BOX_W + 10, 20, 11, -2}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_CLEAR_MESSAGE},
/* {BSCRIPT_BMESSAGE, {BMSG_M3_3, 500, 420, BOX_W + 10, 20, 11, -2}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_CLEAR_MESSAGE},*/
{BSCRIPT_NEW_CONVOY, {BCONVOY_4, 305, 280, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_SCOUT2, 20, -20}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_SCOUT2, -20, -20}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_SCOUT3, -30, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_SCOUT3, 30, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_SCOUT2, -20, 20}},
{BSCRIPT_NEW_SHIP, {BCONVOY_4, BSHIP_SCOUT2, 20, 20}},
{BSCRIPT_SELECT, {BCONVOY_4, 0, 0}},
// {BSCRIPT_BMESSAGE, {BMSG_M3_4, 120, 420, BOX_W + 10, -40, 11, BCONVOY_4}},
{BSCRIPT_BMESSAGE, {BMSG_M3_4, 500, 420, BOX_W + 10, 50, 11, BCONVOY_4}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_CLEAR_MESSAGE},
/*
{BSCRIPT_BMESSAGE, {BMSG_M2_5, 500, 420, BOX_W + 10, 20, 11, -2}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_CLEAR_MESSAGE},
*/
// {BSCRIPT_BMESSAGE, {BMSG_M3_5, 120, 220, BOX_W + 10, 20, 11, -2}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_0, 300, 100, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -10, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -10, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, 10, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, 10, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -17, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -2, -6}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -2, 6}},
{BSCRIPT_SELECT, {BCONVOY_0, 0, 0}},
{BSCRIPT_BMESSAGE, {BMSG_M3_5, 120, 120, BOX_W + 10, -15, 9, BCONVOY_0}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_NEW_CONVOY, {BCONVOY_2, 330, 100, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_MOTH, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_FIGHTER_FRIEND, -6, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_FIGHTER_FRIEND, 6, 0}},
{BSCRIPT_SELECT, {BCONVOY_2, 0, 0}},
{BSCRIPT_BMESSAGE, {BMSG_M3_6, 480, 150, BOX_W + 10, 21, 9, BCONVOY_2}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_CLEAR_MESSAGE},
{BSCRIPT_MOVE, {BCONVOY_0, 0, 305, 200, 3000, RIGHT, 1}},
{BSCRIPT_MOVE, {BCONVOY_2, 0, 335, 200, 3000, RIGHT, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_MOVE, {BCONVOY_0, 0, 35, 220, 3500, LEFT, 1}},
{BSCRIPT_MOVE, {BCONVOY_2, 0, 65, 220, 3500, LEFT, 0}},
{BSCRIPT_MOVE, {BCONVOY_4, 0, 105, 270, 2600, LEFT, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_NEW_CONVOY, {BCONVOY_1, 330, 480, LEFT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD3, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD3, 10, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD3, -10, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, 0, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, -13, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, 13, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, 0, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_OLD2, 0, -17}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_FIGHTER_FRIEND, 18, -15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_FIGHTER_FRIEND, -18, -15}},
{BSCRIPT_SELECT, {BCONVOY_1, 0, 0}},
{BSCRIPT_BMESSAGE, {BMSG_M3_7, 140, 380, BOX_W + 10, -20, 7, BCONVOY_1}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_CLEAR_MESSAGE},
{BSCRIPT_MOVE, {BCONVOY_1, 0, 305, 320, 2500, LEFT, 1}},
{BSCRIPT_MOVE, {BCONVOY_2, 0, 305, 250, 3000, RIGHT, 1}},
{BSCRIPT_SETTLE},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_NEW_CONVOY, {BCONVOY_5, 455, 310, LEFT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_SCOUTCAR, -10, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_SCOUTCAR, 10, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_SCOUT2, -5, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_SCOUT2, -5, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_FIGHTER, -10, -15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_FIGHTER, -15, -20}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_FIGHTER, -10, 15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_5, BSHIP_FIGHTER, -15, 20}},
{BSCRIPT_SELECT, {BCONVOY_5, 0, 0}},
{BSCRIPT_BMESSAGE, {BMSG_M3_8, 490, 120, BOX_W + 10, 10, -35, BCONVOY_5}},
{BSCRIPT_SETTLE},
{BSCRIPT_WAIT, {20}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_END},
/*
{BSCRIPT_HIT_FIRE},
{BSCRIPT_SELECT, {BCONVOY_0, -15, 0}},
{BSCRIPT_SELECT, {BCONVOY_1, -10, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_MOVE, {BCONVOY_0, 0, 200, 250, 3000, RIGHT}},
{BSCRIPT_MOVE, {BCONVOY_1, 0, 200, 150, 2000, LEFT}},
{BSCRIPT_SETTLE},
// {BSCRIPT_HIT_FIRE},
{BSCRIPT_MOVE, {BCONVOY_0, 0, 100, 250, 3000, LEFT}},
{BSCRIPT_MOVE, {BCONVOY_1, 20, 300, 210, 3500, LEFT}},
{BSCRIPT_SETTLE},
// {BSCRIPT_HIT_FIRE},
{BSCRIPT_END},
*/
/*
{BSCRIPT_HEADER, {0}},
{BSCRIPT_BMESSAGE, {BMSG_HELLO}}, // must always have a message - preferably straight after header
{BSCRIPT_NEW_CONVOY, {BCONVOY_0, 100, 200, RIGHT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD3, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -10, -5}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_OLD2, -10, 5}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_MOTH, -15, 10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -20, 15}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -15, -10}},
{BSCRIPT_NEW_SHIP, {BCONVOY_0, BSHIP_FIGHTER_FRIEND, -20, -15}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_1, 300, 200, LEFT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_SCOUT3_HEAVY, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_SCOUT2_HEAVY, 13, -4}},
{BSCRIPT_NEW_SHIP, {BCONVOY_1, BSHIP_SCOUT2_HEAVY, 13, 4}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_2, 300, 300, LEFT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_SCOUTBASE, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_SCOUTCAR, 18, -8}},
{BSCRIPT_NEW_SHIP, {BCONVOY_2, BSHIP_SCOUT2_HEAVY, 18, 8}},
{BSCRIPT_NEW_CONVOY, {BCONVOY_3, 100, 50, LEFT}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUTBASE, 0, 0}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUTCAR, 18, -8}},
{BSCRIPT_NEW_SHIP, {BCONVOY_3, BSHIP_SCOUT2_HEAVY, 18, 8}},
{BSCRIPT_HIT_FIRE},
{BSCRIPT_SELECT, {BCONVOY_0, -15, 0}},
{BSCRIPT_SELECT, {BCONVOY_1, -10, 0}},
{BSCRIPT_SETTLE},
{BSCRIPT_MOVE, {BCONVOY_0, 0, 200, 250, 3000, RIGHT}},
{BSCRIPT_MOVE, {BCONVOY_1, 0, 200, 150, 2000, LEFT}},
{BSCRIPT_SETTLE},
// {BSCRIPT_HIT_FIRE},
{BSCRIPT_MOVE, {BCONVOY_0, 0, 100, 250, 3000, LEFT}},
{BSCRIPT_MOVE, {BCONVOY_1, 20, 300, 210, 3500, LEFT}},
{BSCRIPT_SETTLE},
// {BSCRIPT_HIT_FIRE},*/
// {BSCRIPT_END}
};
/*
char bmsg [BMSGS] [150] =
{
"Anti-fighter missile. Very effective against fighters. Lock on to target. ",
"Anti-warship missile. Locks on to warships only. Powerful. ",
"Torpedo. Most powerful weapon. ",
"Rocket. ",
"Hello everyone this is a $B test message $C to see how this msg thing works. $P Does it? $P $P Let's find out! Also this is testing the small font. "
// remember trailing space!!
};
*/
int waiting;
int waiting_for_fire;
int briefing_pos;
int selecting [2];
enum
{
BOVER_MENU_START,
BOVER_MENU_REPLAY,
BOVER_MENU_DATA,
BOVER_MENU_QUIT,
BOVER_MENU_END
};
/*
#define BCOL_BACK (COL_F1 + TRANS_BLUE1)
#define BCOL_SCREEN (COL_F1)
#define BCOL_DARK (COL_STAR1)
#define BCOL_EDGE (COL_F2)
#define BCOL_TEXT (COL_F3 + TRANS_BLUE3)
*/
#define BCOL_BACK (COL_BOX1)
#define BCOL_SCREEN (COL_BOX1)
#define BCOL_DARK (COL_BOX0)
#define BCOL_EDGE (COL_BOX2)
#define BCOL_TEXT (COL_BOX4)
//(COL_F6 + TRANS_BLUE3)
#define EDGE 1
enum
{
CHOOSE_CANNON,
CHOOSE_WING1,
CHOOSE_WEAPON1,
CHOOSE_WEAPON2,
CHOOSE_LAUNCH,
CHOOSE_REPLAY,
CHOOSE_END
};
void init_mission_briefing(void)
{
int c, s, i;
for (c = 0; c < BCONVOYS; c ++)
{
bconvoy[c].exists = 0;
}
for (s = 0; s < BSHIPS; s ++)
{
bship[s].type = BSHIP_NONE;
}
for (s = 0; s < BSELECT; s ++)
{
bselect[s].exists = 0;
}
briefing_pos = 0;
for (i = 0; i < BSCRIPTS; i ++)
{
if (bscript [i].type == BSCRIPT_HEADER
&& bscript [i].var [0] == arena.stage)
{
briefing_pos = i;
break;
}
}
bline[0].text [0] = END_MESSAGE;
tbox_exists = 0;
waiting = 0;
waiting_for_fire = 0;
}
int mission_briefing(void)
{
init_mission_briefing();
int menu_return = -1;
char replay = 0;
do
{
replay = 0;
if (briefing_loop() == 1)
return 0; // must have quit
if (bscript[briefing_pos].type == BSCRIPT_END
|| pressing_a_key(0, CKEY_FIRE2, JBUTTON_FIRE2))
{
bkey_wait [0] = 10;
play_basicwfv(WAV_SELECT0, FREQ_BSELECT, VOL_BSELECT1);
// || options.joystick_available [0] && joy[0].button[options.joy_button [0] [1]].b))
do
{
menu_return = briefing_over_menu();
switch(menu_return)
{
case BOVER_MENU_START:
play_basicwfv(WAV_SELECT1, FREQ_BSELECT1, VOL_BSELECT1);
menu_return = choose_weapons();
if (menu_return == 0)
{
init_mission_briefing();
replay = 1;
break;
}
play_basicwfv(WAV_SELECT1, FREQ_BSELECT1, VOL_BSELECT1);
return 1;
case BOVER_MENU_REPLAY:
init_mission_briefing();
replay = 1;
play_basicwfv(WAV_SELECT1, FREQ_BSELECT1, VOL_BSELECT1);
break;
case BOVER_MENU_DATA:
// data
break;
case BOVER_MENU_QUIT:
if (ask_bover_quit())
{
play_basicwfv(WAV_SELECT0, FREQ_BSELECT2, VOL_BSELECT1);
return 0;
}
break;
}
} while (replay == 0);
}
} while (TRUE);
return 1;
}
int briefing_loop(void)
{
if (key[KEY_ESC])
{
return ask_bover_quit();
}
briefing_counter ++;
run_bconvoys();
/* if (tbox_exists)
{
run_tbox();
if (tbox_in <= 0
&& tbox_flash_out <= 0
&& tbox_out <= 0)
{
check_for_fire();
if (waiting_for_fire == 0)
tbox_flash_out = 20;
}
}*/
if (tbox_exists)
{
run_tbox();
/* if (tbox_in <= 0
&& tbox_flash_out <= 0
&& tbox_out <= 0)
{
check_for_fire();
if (waiting_for_fire == 0)
tbox_flash_out = 20;
}*/
}
// else
{
if (bscript[briefing_pos].type == BSCRIPT_SETTLE)
{
if (check_settled() == 0)
waiting = 1;
} // wait for all convoys to stop moving
if (waiting > 0)
{
waiting --;
}
else
{
if (waiting_for_fire > 0)
{
check_for_fire();
}
else
{
run_bscripts();
}
}
}
// if (key [KEY_ESC])
// exit(5);
bdisplay();
vsync();
blit(display[0], screen, 0, 0, 0, 0, 800, 600);
do
{
rest(1);
// thing ++;
} while (ticked == 0);
ticked = 0;
return 0;
}
#define MAP_X 10
#define MAP_Y 10
#define MAP_W 600
#define MAP_H 550
#define BOX_X 630
#define BOX_Y 10
#define BOX_H 550
void bdisplay(void)
{
clear_to_color(display [0], 0);
rectfill(display[0], MAP_X-EDGE, MAP_Y-EDGE, MAP_X + MAP_W+EDGE, MAP_Y + MAP_H+EDGE, BCOL_EDGE);
rectfill(display[0], MAP_X, MAP_Y, MAP_X + MAP_W, MAP_Y + MAP_H, BCOL_DARK);
rectfill(display[0], MAP_X, MAP_Y + 5, MAP_X + MAP_W, MAP_Y + 22, BCOL_EDGE);
textprintf_centre_ex(display[0], small_font, MAP_X + (MAP_W>>1), MAP_Y+7, BCOL_TEXT, -1, "Mission Briefing");
int s, c;
// int col;
/*
for (c = 0; c < BCONVOYS; c ++)
{
if (bconvoy [c].exists == 0)
continue;
textprintf_ex(display[0], small_font, MAP_X + (bconvoy[c].x>>10), MAP_Y + (bconvoy[c].y>>10), -1, -1, "%i, %i", bconvoy[c].x>>10, bconvoy[c].y>>10);
}*/
for (s = 0; s < BSHIPS; s ++)
{
if (bship[s].type == BSHIP_NONE)
continue;
if (bconvoy[bship[s].convoy].face == RIGHT)
draw_sprite(display[0], bsprite [bship[s].side] [get_bsprite(bship[s].type)] [0], MAP_X + (bconvoy[bship[s].convoy].x>>10) + bship[s].x - 6, MAP_Y + (bconvoy[bship[s].convoy].y>>10) + bship[s].y - 6);
else
draw_sprite_h_flip(display[0], bsprite [bship[s].side] [get_bsprite(bship[s].type)] [0], MAP_X + (bconvoy[bship[s].convoy].x>>10) - bship[s].x - 6, MAP_Y + (bconvoy[bship[s].convoy].y>>10) - bship[s].y - 6);
// circlefill(display[0], MAP_X + (bconvoy[bship[s].convoy].x>>10) + bship[s].x, MAP_Y + (bconvoy[bship[s].convoy].x>>10) + bship[s].y, 2, col);
}
for (s = 0; s < BSELECT; s ++)
{
if (bselect[s].exists == 0
|| bselect[s].count <= 0)
continue;
c = bselect[s].count*3 - 10 - 20;
if (c < 10)
c = 10;
vline(display[0], bselect[s].x + bselect[s].x1 - c, bselect[s].y + bselect[s].y1 - c, bselect[s].y + bselect[s].y1 - c + 4, COL_F5 + TRANS_BLUE3);
hline(display[0], bselect[s].x + bselect[s].x1 - c, bselect[s].y + bselect[s].y1 - c, bselect[s].x + bselect[s].x1 - c + 4, COL_F5 + TRANS_BLUE3);
vline(display[0], bselect[s].x + bselect[s].x2 + c, bselect[s].y + bselect[s].y1 - c, bselect[s].y + bselect[s].y1 - c + 4, COL_F5 + TRANS_BLUE3);
hline(display[0], bselect[s].x + bselect[s].x2 + c, bselect[s].y + bselect[s].y1 - c, bselect[s].x + bselect[s].x2 + c - 4, COL_F5 + TRANS_BLUE3);
vline(display[0], bselect[s].x + bselect[s].x1 - c, bselect[s].y + bselect[s].y2 + c, bselect[s].y + bselect[s].y2 + c - 4, COL_F5 + TRANS_BLUE3);
hline(display[0], bselect[s].x + bselect[s].x1 - c, bselect[s].y + bselect[s].y2 + c, bselect[s].x + bselect[s].x1 - c + 4, COL_F5 + TRANS_BLUE3);
vline(display[0], bselect[s].x + bselect[s].x2 + c, bselect[s].y + bselect[s].y2 + c, bselect[s].y + bselect[s].y2 + c - 4, COL_F5 + TRANS_BLUE3);
hline(display[0], bselect[s].x + bselect[s].x2 + c, bselect[s].y + bselect[s].y2 + c, bselect[s].x + bselect[s].x2 + c - 4, COL_F5 + TRANS_BLUE3);
/*
vline(display[0], MAP_X + bselect[s].x - bselect[s].x1 - c, MAP_Y + bselect[s].y - bselect[s].y1 - c, MAP_Y + bselect[s].y - bselect[s].y1 - c + 4, COL_F5 + TRANS_BLUE3);
hline(display[0], MAP_X + bselect[s].x - bselect[s].x1 - c, MAP_Y + bselect[s].y - bselect[s].y1 - c, MAP_X + bselect[s].x - bselect[s].x1 - c + 4, COL_F5 + TRANS_BLUE3);
vline(display[0], MAP_X + bselect[s].x + bselect[s].x2 + c, MAP_Y + bselect[s].y - bselect[s].y1 - c, MAP_Y + bselect[s].y - bselect[s].y1 - c + 4, COL_F5 + TRANS_BLUE3);
hline(display[0], MAP_X + bselect[s].x + bselect[s].x2 + c, MAP_Y + bselect[s].y - bselect[s].y1 - c, MAP_X + bselect[s].x + bselect[s].x2 + c - 4, COL_F5 + TRANS_BLUE3);
vline(display[0], MAP_X + bselect[s].x - bselect[s].x1 - c, MAP_Y + bselect[s].y + bselect[s].y2 + c, MAP_Y + bselect[s].y + bselect[s].y2 + c - 4, COL_F5 + TRANS_BLUE3);
hline(display[0], MAP_X + bselect[s].x - bselect[s].x1 - c, MAP_Y + bselect[s].y + bselect[s].y2 + c, MAP_X + bselect[s].x - bselect[s].x1 - c + 4, COL_F5 + TRANS_BLUE3);
vline(display[0], MAP_X + bselect[s].x + bselect[s].x2 + c, MAP_Y + bselect[s].y + bselect[s].y2 + c, MAP_Y + bselect[s].y + bselect[s].y2 + c - 4, COL_F5 + TRANS_BLUE3);
hline(display[0], MAP_X + bselect[s].x + bselect[s].x2 + c, MAP_Y + bselect[s].y + bselect[s].y2 + c, MAP_X + bselect[s].x + bselect[s].x2 + c - 4, COL_F5 + TRANS_BLUE3);