-
Notifications
You must be signed in to change notification settings - Fork 33
/
3d_act2.cpp
6934 lines (5750 loc) · 156 KB
/
3d_act2.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
/*
BStone: A Source port of
Blake Stone: Aliens of Gold and Blake Stone: Planet Strike
Copyright (c) 1992-2013 Apogee Entertainment, LLC
Copyright (c) 2013-2021 Boris I. Bendovsky (bibendovsky@hotmail.com)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the
Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <cmath>
#include <cstring>
#include <algorithm>
#include <array>
#include "audio.h"
#include "id_ca.h"
#include "id_heads.h"
#include "id_sd.h"
#include "id_us.h"
#include "id_vl.h"
#include "bstone_math.h"
// 3d_def.h stuff
//
namespace
{
const std::int16_t DOOR_RUBBLE_STATNUM = 112; // Door Rubble sprite
struct ofs_anim_t
{
static const int animtype_offset = 0;
static const int animtype_size = 2;
static const int curframe_offset = animtype_offset + animtype_size;
static const int curframe_size = 5;
static const int maxframe_offset = curframe_offset + curframe_size;
static const int maxframe_size = 5;
static const int animdir_offset = maxframe_offset + maxframe_size;
static const int animdir_size = 1;
template<int TOffset, int TSize>
static std::uint16_t get(
const objtype* o)
{
return (o->temp3 >> TOffset) & ((1 << TSize) - 1);
}
template<int TOffset, int TSize>
static void set(
const std::uint16_t value,
objtype* o)
{
o->temp3 &= ~(((1 << TSize) - 1) << TOffset);
o->temp3 |= ((value & ((1 << TSize) - 1)) << TOffset);
}
static std::uint16_t get_animtype(
const objtype* o)
{
return get<animtype_offset, animtype_size>(o);
}
static void set_animtype(
const std::uint16_t value,
objtype* o)
{
set<animtype_offset, animtype_size>(value, o);
}
static std::uint16_t get_curframe(
const objtype* o)
{
return get<curframe_offset, curframe_size>(o);
}
static void set_curframe(
const std::uint16_t value,
objtype* o)
{
set<curframe_offset, curframe_size>(value, o);
}
static std::uint16_t get_maxframe(
const objtype* o)
{
return get<maxframe_offset, maxframe_size>(o);
}
static void set_maxframe(
const std::uint16_t value,
objtype* o)
{
set<maxframe_offset, maxframe_size>(value, o);
}
static std::uint16_t get_animdir(
const objtype* o)
{
return get<animdir_offset, animdir_size>(o);
}
static void set_animdir(
const std::uint16_t value,
objtype* o)
{
set<animdir_offset, animdir_size>(value, o);
}
}; // ofs_anim_t
std::uint16_t MAPSPOT(
const std::uint8_t x,
const std::uint8_t y,
const std::uint8_t plane)
{
return mapsegs[plane][farmapylookup[y] + x];
}
objtype* SLIDE_TEMP(
const objtype* const obj)
{
return ui16_to_actor(obj->hitpoints);
}
void SpawnExplosion(
const double x,
const double y)
{
SpawnCusExplosion(x, y, SPR_EXPLOSION_1, 4, 5, explosionobj);
}
void SpawnFlash(
const double x,
const double y)
{
SpawnCusExplosion(x, y, SPR_EXPLOSION_1, 4, 5, deadobj);
}
} // namespace
void FirstSighting(
objtype* ob);
bool SightPlayer(
objtype* ob);
void TakeDamage(
std::int16_t points,
objtype* attacker);
void OpenDoor(
std::int16_t door);
bool CheckView(
objtype* from_obj,
objtype* to_obj);
std::int16_t CalcAngle(
objtype* from_obj,
objtype* to_obj);
bool ClipMove(
objtype* ob,
const double xmove,
const double ymove);
void DisplaySwitchOperateMsg(
int coords);
void T_Hit(
objtype* ob);
void CheckForSpecialTile(
objtype* obj,
std::uint16_t tilex,
std::uint16_t tiley);
void ExplodeRadius(
objtype* obj,
std::int16_t damage,
bool damageplayer);
void ToggleBarrier(
objtype* obj);
bool AnimateOfsObj(
objtype* obj);
void T_Seek(
objtype* ob);
void T_ExplodeDamage(
objtype* obj);
void AdvanceAnimFWD(
objtype* obj);
void T_ChangeShape(
objtype* obj);
void T_LiquidStand(
objtype* obj);
void T_ChangeShape(
objtype* obj);
void T_Security(
objtype* obj);
/*
=============================================================================
LOCAL CONSTANTS
=============================================================================
*/
#define BFG_SHOT_STOPS (1)
constexpr auto SPDPATROL = bstone::math::fixed_to_floating(512);
constexpr auto SPDPROJ = bstone::math::fixed_to_floating(7168);
constexpr auto PROJCHECKSIZE = bstone::math::fixed_to_floating(0x8000); // scan for actor range
constexpr auto PROJWALLSIZE = bstone::math::fixed_to_floating(0x2000); // collision with wall range
constexpr auto PROJECTILESIZE = bstone::math::fixed_to_floating(0xC000);
#define SEEK_TURN_DELAY (30) // tics
#define CLOSE_RANGE (1) // Tiles
constexpr auto ALIENSPEED = SPDPATROL;
#define ALIENAMMOINIT (30 + (US_RndT() % 60))
#define GR_DAMAGE (40 + (US_RndT() & 0x7F)) // 20 & ... 0x3F
#define BFG_DAMAGE (GR_DAMAGE << 1) // Hit Point damage cause by BFG
#define PLASMA_DETONATOR_DAMAGE (500)
#define DETONATOR_FLASH_RATE (20)
#define EXPLODE_DAMAGE (20) // 5
#define VPOST_BARRIER_SPEED (7) // Tics per anim step
#define VPOST_WAIT_DELAY (90) // Tics delay in cycling
// Min number of statics avail
// before 50/50 chance of door rubble on exp. doors.
#define DR_MIN_STATICS (50)
/*
=============================================================================
GLOBAL VARIABLES
=============================================================================
*/
std::int8_t detonators_spawned = 0;
/*
=============================================================================
LOCAL VARIABLES
=============================================================================
*/
const StartHitPoints aog_start_hit_points =
{
//
// BABY MODE
//
SubStartHitPoints
{
6, // Rent-A-Cop
6, // Hang Terrot
6, // general scientist
28, // pod alien
18, // Electro-Alien
1, // Electro-Sphere
43, // ProGuard
20, // Genetic Guard
27, // Mutant Human Type 1
27, // Mutant Human Type 2
1, // Large Canister Alien - CONTAINER HP
37, // Large Can-Alien - ALIEN HP
1, // Small Canister Alien - CONTAINER HP
30, // Small Can-Alien - ALIEN HP
1, // Gurney Mutant - Waiting HP
33, // Gurney Mutant - Spawned HP
47, // Liquid Alien -
88, // Swat Guards
50, // Goldstern
0, // Morphed Goldstern
17, // Volatile Material Transport
20, // Floating Bomb
150, // Vital Defence Obj - DON'T CHANGE
800, // spider_mutant
850, // breather_beast
900, // cyborg_warror
950, // reptilian_warrior
1000, // acid_dragon
1050, // mech_guardian
0, // final_boss 1
0, // final_boss 2
0, // final_boss 3
0, // final_boss 4
0, // Blake
1, // Crate 1
1, // Crate 2
1, // Crate 3
0, // green ooze
0, // black ooze
0, // green ooze 2
0, // black ooze 2
1, // Pod egg
0, // morphing_spider_mutant
0, // morphing_reptilian_warrior
0, // morphing_Mutant Human Type 2
},
//
// DON'T HURT ME MODE
//
SubStartHitPoints
{
9, // Rent-A-Cop
9, // Hang Terrot
9, // general scientist
60, // pod alien
37, // Electro-Alien
1, // Electro-Sphere
63, // ProGuard
60, // Genetic Guard
50, // Mutant Human Type 1
50, // Mutant Human Type 2
1, // Large Canister Alien - CONTAINER HP
75, // Large Can-Alien - ALIEN HP
1, // Small Canister Alien - CONTAINER HP
60, // Small Can-Alien - ALIEN HP
1, // Gurney Mutant - Waiting HP
37, // Gurney Mutant - Spawned HP
66, // Liquid Alien -
112, // SWAT Guards
63, // Goldstern
0, // Morphed Goldstern
25, // Volatile Material Transport
40, // Floating Bomb
175, // Vital Defence Obj - DON'T CHANGE
1000, // spider_mutant
1250, // breather_beast
1500, // cyborg_warror
1750, // reptilian_warrior
2000, // acid_dragon
2500, // mech_guardian
0, // final_boss 1
0, // final_boss 2
0, // final_boss 3
0, // final_boss 4
0, // Blake
1, // Crate 1
1, // Crate 2
1, // Crate 3
0, // green ooze
0, // black ooze
0, // green ooze 2
0, // black ooze 2
1, // Pod egg
0, // morphing_spider_mutant
0, // morphing_reptilian_warrior
0, // morphing_Mutant Human Type 2
},
//
// BRING 'EM ON MODE
//
SubStartHitPoints
{
25, // Rent-A-Cop
23, // Hang Terrot
23, // general scientist
160, // pod alien
112, // Electro-Alien
1, // Electro-Sphere
150, // ProGuard
180, // Genetic Guard
155, // Mutant Human Type 1
155, // Mutant Human Type 2
1, // Large Canister Alien - CONTAINER HP
225, // Large Can-Alien - ALIEN HP
1, // Small Canister Alien - CONTAINER HP
180, // Small Can-Alien - ALIEN HP
1, // Gurney Mutant - Waiting HP
150, // Gurney Mutant - Spawned HP
163, // Liquid Alien -
325, // SWAT Guards
125, // Goldstern
0, // Morphed Goldstern
63, // Volatile Material Transport
60, // Floating Bomb
375, // Vital Defence Obj - DON'T CHANGE
2000, // spider_mutant
2500, // breather_beast
3000, // cyborg_warror
3500, // reptilian_warrior
4000, // acid_dragon
5000, // mech_guardian
0, // final_boss 1
0, // final_boss 2
0, // final_boss 3
0, // final_boss 4
0, // Blake
1, // Crate 1
1, // Crate 2
1, // Crate 3
0, // green ooze
0, // black ooze
0, // green ooze 2
0, // black ooze 2
1, // Pod egg
0, // morphing_spider_mutant
0, // morphing_reptilian_warrior
0, // morphing_Mutant Human Type 2
},
//
// DEATH INCARNATE MODE
//
SubStartHitPoints
{
38, // Rent-A-Cop
28, // Hang Terrot
28, // general scientist
210, // pod alien
150, // Electro-Alien
1, // Electro-Sphere
175, // ProGuard
240, // Genetic Guard
210, // Mutant Human Type 1
210, // Mutant Human Type 2
1, // Large Canister Alien - CONTAINER HP
300, // Large Can-Alien - ALIEN HP
1, // Small Canister Alien - CONTAINER HP
240, // Small Can-Alien - ALIEN HP
1, // Gurney Mutant - Waiting HP
200, // Gurney Mutant - Spawned HP
210, // Liquid Alien -
425, // SWAT Gaurds
188, // Goldstern
0, // Morphed Goldstern
75, // Volatile Material Transport
85, // Floating Bomb
450, // Vital Defence Obj - DON'T CHANGE
3000, // spider_mutant
3500, // breather_beast
4000, // cyborg_warror
4500, // reptilian_warrior
5000, // acid_dragon
6000, // mech_guardian
0, // final_boss 1
0, // final_boss 2
0, // final_boss 3
0, // final_boss 4
0, // Blake
1, // Crate 1
1, // Crate 2
1, // Crate 3
0, // green ooze
0, // black ooze
0, // green ooze 2
0, // black ooze 2
1, // Pod egg
0, // morphing_spider_mutant
0, // morphing_reptilian_warrior
0, // morphing_Mutant Human Type 2
},
}; // aog_start_hit_points
const StartHitPoints ps_start_hit_points =
{
//
// BABY MODE
//
SubStartHitPoints
{
4, // Rent-A-Cop
4, // Hang Terrot
4, // general scientist
22, // pod alien
13, // Electro-Alien
1, // Electro-Sphere
33, // ProGuard
20, // Genetic Guard
24, // Mutant Human Type 1
24, // Mutant Human Type 2
1, // Large Canister Alien - CONTAINER HP
34, // Large Can-Alien - ALIEN HP
1, // Small Canister Alien - CONTAINER HP
25, // Small Can-Alien - ALIEN HP
1, // Gurney Mutant - Waiting HP
27, // Gurney Mutant - Spawned HP
30, // Liquid Alien -
78, // Swat Guards
90, // Goldstern
4000, // Morphed Goldstern
17, // Volatile Material Transport
15, // Floating Bomb
175, // Vital Defence Obj - DON'T CHANGE
60, // spider_mutant
65, // breather_beast
70, // cyborg_warror
65, // reptilian_warrior
60, // acid_dragon
65, // mech_guardian
1600, // final_boss 1
1700, // final_boss 2
1800, // final_boss 3
1900, // final_boss 4
1, // Blake
1, // Crate 1
1, // Crate 2
1, // Crate 3
1, // green ooze
1, // black ooze
1, // green ooze 2
1, // black ooze 2
1, // Pod egg
1, // morphing_spider_mutant
1, // morphing_reptilian_warrior
1, // morphing_Mutant Human Type 2
},
//
// DON'T HURT ME MODE
//
SubStartHitPoints
{
9, // Rent-A-Cop
9, // Hang Terrot
9, // general scientist
60, // pod alien
37, // Electro-Alien
1, // Electro-Sphere
63, // ProGuard
60, // Genetic Guard
50, // Mutant Human Type 1
50, // Mutant Human Type 2
1, // Large Canister Alien - CONTAINER HP
75, // Large Can-Alien - ALIEN HP
1, // Small Canister Alien - CONTAINER HP
60, // Small Can-Alien - ALIEN HP
1, // Gurney Mutant - Waiting HP
37, // Gurney Mutant - Spawned HP
66, // Liquid Alien -
112, // SWAT Guards
100, // Goldstern
4500, // Morphed Goldstern
25, // Volatile Material Transport
40, // Floating Bomb
175, // Vital Defence Obj - DON'T CHANGE
100, // spider_mutant
115, // breather_beast
100, // cyborg_warror
115, // reptilian_warrior
100, // acid_dragon
115, // mech_guardian
1700, // final_boss 1
1800, // final_boss 2
1900, // final_boss 3
2000, // final_boss 4
1, // Blake
1, // Crate 1
1, // Crate 2
1, // Crate 3
1, // green ooze
1, // black ooze
1, // green ooze 2
1, // black ooze 2
1, // Pod egg
1, // morphing_spider_mutant
1, // morphing_reptilian_warrior
1, // morphing_Mutant Human Type 2
},
//
// BRING 'EM ON MODE
//
SubStartHitPoints
{
25, // Rent-A-Cop
23, // Hang Terrot
23, // general scientist
160, // pod alien
112, // Electro-Alien
1, // Electro-Sphere
150, // ProGuard
180, // Genetic Guard
155, // Mutant Human Type 1
155, // Mutant Human Type 2
1, // Large Canister Alien - CONTAINER HP
225, // Large Can-Alien - ALIEN HP
1, // Small Canister Alien - CONTAINER HP
180, // Small Can-Alien - ALIEN HP
1, // Gurney Mutant - Waiting HP
150, // Gurney Mutant - Spawned HP
163, // Liquid Alien -
325, // SWAT Guards
150, // Goldstern
4800, // Morphed Goldstern
63, // Volatile Material Transport
60, // Floating Bomb
175, // Vital Defence Obj - DON'T CHANGE
150, // spider_mutant
165, // breather_beast
150, // cyborg_warror
165, // reptilian_warrior
150, // acid_dragon
165, // mech_guardian
1800, // final_boss 1
1900, // final_boss 2
2000, // final_boss 3
2100, // final_boss 4
1, // Blake
1, // Crate 1
1, // Crate 2
1, // Crate 3
1, // green ooze
1, // black ooze
1, // green ooze 2
1, // black ooze 2
1, // Pod egg
1, // morphing_spider_mutant
1, // morphing_reptilian_warrior
1, // morphing_Mutant Human Type 2
},
//
// DEATH INCARNATE MODE
//
SubStartHitPoints
{
38, // Rent-A-Cop
28, // Hang Terrot
28, // general scientist
210, // pod alien
150, // Electro-Alien
1, // Electro-Sphere
175, // ProGuard
240, // Genetic Guard
210, // Mutant Human Type 1
210, // Mutant Human Type 2
1, // Large Canister Alien - CONTAINER HP
300, // Large Can-Alien - ALIEN HP
1, // Small Canister Alien - CONTAINER HP
240, // Small Can-Alien - ALIEN HP
1, // Gurney Mutant - Waiting HP
200, // Gurney Mutant - Spawned HP
210, // Liquid Alien -
425, // SWAT Gaurds
250, // Goldstern
5400, // Morphed Goldstern
75, // Volatile Material Transport
85, // Floating Bomb
175, // Vital Defence Obj - DON'T CHANGE
200, // spider_mutant
225, // breather_beast
200, // cyborg_warror
225, // reptilian_warrior
200, // acid_dragon
225, // mech_guardian
1900, // final_boss 1
2000, // final_boss 2
2100, // final_boss 3
2200, // final_boss 4
1, // Blake
1, // Crate 1
1, // Crate 2
1, // Crate 3
1, // green ooze
1, // black ooze
1, // green ooze 2
1, // black ooze 2
1, // Pod egg
1, // morphing_spider_mutant
1, // morphing_reptilian_warrior
1, // morphing_Mutant Human Type 2
},
}; // ps_start_hit_points
const StartHitPoints* starthitpoints = nullptr;
using BossIds = std::vector<std::int16_t>;
BossIds BossShotShapes;
BossIds BossShapes;
BossIds MorphShapes;
BossIds MorphEndShapes;
BossIds MorphSounds;
std::uint16_t MorphClass[] = {
spider_mutantobj,
reptilian_warriorobj,
mutant_human2obj,
};
void initialize_hit_point_table()
{
const auto& assets_info = get_assets_info();
starthitpoints = (assets_info.is_aog() ? &aog_start_hit_points : &ps_start_hit_points);
}
std::uint16_t get_start_hit_point(
const int index)
{
if (index >= NUMHITENEMIES)
{
return 0;
}
return (*starthitpoints)[gamestate.difficulty][index];
}
void initialize_boss_constants()
{
const auto& assets_info = get_assets_info();
BossShotShapes = {
SPR_BOSS1_PROJ1,
0,
0,
0,
SPR_BOSS5_PROJ1,
0,
0,
assets_info.is_ps() ? SPR_BOSS10_SPIT1 : static_cast<std::int16_t>(0),
};
BossShapes = {
SPR_BOSS1_W1,
assets_info.is_aog_sw() ? static_cast<std::int16_t>(0) : SPR_BOSS2_W1,
assets_info.is_aog_sw() ? static_cast<std::int16_t>(0) : SPR_BOSS3_W1,
assets_info.is_aog_sw() ? static_cast<std::int16_t>(0) : SPR_BOSS4_W1,
assets_info.is_aog_sw() ? static_cast<std::int16_t>(0) : SPR_BOSS5_W1,
assets_info.is_aog_sw() ? static_cast<std::int16_t>(0) : SPR_BOSS6_W1,
assets_info.is_ps() ? SPR_BOSS7_W1 : static_cast<std::int16_t>(0),
assets_info.is_ps() ? SPR_BOSS8_W1 : static_cast<std::int16_t>(0),
assets_info.is_ps() ? SPR_BOSS9_W1 : static_cast<std::int16_t>(0),
assets_info.is_ps() ? SPR_BOSS10_W1 : static_cast<std::int16_t>(0),
};
MorphShapes = {
SPR_BOSS1_MORPH1,
SPR_BOSS4_MORPH1,
SPR_MUTHUM2_MORPH1,
};
MorphEndShapes = {
SPR_BOSS1_W1,
assets_info.is_aog_sw() ? static_cast<std::int16_t>(0) : SPR_BOSS4_W1,
SPR_MUTHUM2_W1,
};
MorphSounds = {
SCANHALTSND,
GGUARDHALTSND,
DOGBOYHALTSND,
};
}
std::uint16_t bars_connected = 0;
std::uint16_t SpecialSpawnFlags[] = {
FL2_DROP_RKEY,
FL2_DROP_YKEY,
FL2_DROP_BKEY,
FL2_DROP_BFG,
FL2_DROP_ION,
FL2_DROP_DETONATOR,
};
void T_Path(
objtype* ob);
void T_Shoot(
objtype* ob);
void T_Shade(
objtype* obj);
void T_Chase(
objtype* ob);
void T_Projectile(
objtype* ob);
void T_Stand(
objtype* ob);
void T_OfsThink(
objtype* obj);
void A_DeathScream(
objtype* ob);
std::int16_t RandomSphereDir(
enemy_t dir);
void CheckForcedMove(
objtype* ob);
void T_SwatWound(
objtype* ob);
void T_BlowBack(
objtype* obj);
void DoAttack(
objtype* ob);
bool MoveTrappedDiag(
objtype* ob);
bool CheckTrappedDiag(
objtype* ob);
void ChangeShootMode(
objtype* ob);
static int get_remaining_generators()
{
int remaining_generators = 0;
for (objtype* o = player->next; o; o = o->next)
{
if (o->obclass != rotating_cubeobj)
{
continue;
}
if ((o->flags & FL_SHOOTABLE) == 0)
{
continue;
}
remaining_generators += 1;
}
return remaining_generators;
}
static void display_remaining_generators()
{
static const std::string message_part_1 =
"^FC57 PROJECTION GENERATOR\r"
" DESTROYED!\r"
"\r"
"^FCA6 - "
;
static const std::string message_part_2 =
" REMAINING -\r"
" DESTROY THEM TO WIN!"
;
const auto remaining_generators = get_remaining_generators();
static std::string message;
message =
message_part_1 +
std::to_string(remaining_generators) +
message_part_2;
DISPLAY_TIMED_MSG(message.c_str(), MP_FLOOR_UNLOCKED, MT_GENERAL);
}
// ===========================================================================
//
// OFFSET OBJECT ROUTINES
//
// * NOTES: OffsetObjects require the use of TEMP1 of the object structure!
//
// * NOTES: THINK function AnimateOfsObj() requires the use of TEMP3 of the
// object structure!
//
// ===========================================================================
//
// Local Externs
//
extern statetype s_ofs_stand;
extern statetype s_ofs_chase1;
extern statetype s_ofs_chase1s;
extern statetype s_ofs_chase2;
extern statetype s_ofs_chase3;
extern statetype s_ofs_chase3s;
extern statetype s_ofs_chase4;
extern statetype s_ofs_pain;
extern statetype s_ofs_die1;
extern statetype s_ofs_die1s;
extern statetype s_ofs_die2;
extern statetype s_ofs_die3;
extern statetype s_ofs_die4;
extern statetype s_ofs_die5;
extern statetype s_ofs_attack1;
extern statetype s_ofs_attack2;
extern statetype s_ofs_attack3;
extern statetype s_ofs_spit1;
extern statetype s_ofs_spit2;
extern statetype s_ofs_spit3;
extern statetype s_ofs_shoot1;
extern statetype s_ofs_shoot2;
extern statetype s_ofs_shoot3;
extern statetype s_ofs_shoot4;
extern statetype s_ofs_shoot5;
extern statetype s_ofs_shoot6;
extern statetype s_ofs_shoot7;
extern statetype s_ofs_smart_anim;
extern statetype s_ofs_smart_anim2;
extern statetype s_ofs_projectile1;
extern statetype s_ofs_projectile2;
extern statetype s_ofs_proj_exp1;
extern statetype s_ofs_proj_exp2;
extern statetype s_ofs_pod_spit1;
extern statetype s_ofs_pod_spit2;
extern statetype s_ofs_pod_spit3;
extern statetype s_ofs_pod_attack1;
extern statetype s_ofs_pod_attack1a;
extern statetype s_ofs_pod_attack2;
extern statetype s_ofs_pod_death1;
extern statetype s_ofs_pod_death2;
extern statetype s_ofs_pod_death3;
extern statetype s_ofs_roam;
extern statetype s_ofs_esphere_death1;
extern statetype s_ofs_esphere_death2;
extern statetype s_ofs_esphere_death3;