-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0801_cProjectOneBoss.cpp
5676 lines (4456 loc) · 215 KB
/
0801_cProjectOneBoss.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
///////////////////////////////////////////////////////
//*-------------------------------------------------*//
//| Part of Project One (https://www.maus-games.at) |//
//*-------------------------------------------------*//
//| Copyright (c) 2010 Martin Mauersics |//
//| Released under the zlib License |//
//*-------------------------------------------------*//
///////////////////////////////////////////////////////
#include "main.h"
// - yellow: [54] phase 3+A, phase 1+A
// - orange: [78] transition 2, transition 1, phase 2
// - red: [76] phase 3, phase 2
// - magenta: [78] phase 1+A, phase 1+A, phase 2
// - purple: [75] transition, phase, phase, phase, phase
// - blue: [63] phase 1, phase 3, phase 1
// - cyan: [40] phase 2, phase 3
// - green: [63] phase 2, transition 1, phase 2
// - white: [66] transition, transition, transition, transition, transition
// - intro: phase
// - boss should use absolutely all mechanics from the game (so far), a color for every mission and its mechanics, with new combinations and twists, this makes the fight extremely long (>12 min), but it is possible to scale by reducing the required number of colors the player has to beat
// NOTE: even though P1 was originally Project One, it indeed became a reference to Player One, as the model was the original player ship from the first edition
// TODO 1: (remove turf from base classes)
// TODO 1: hard mode: add another mechanic to each sub-stage, player needs to attack in last phase
// TODO 1: hard mode: turf
// yellow:
// - spikes should be active long enough that it is important for the player to adapt his position to the up and down of the spikes
// - rotation of the circle ghosts is against the rotation of the moles
// - spikes should not fly parallel to the second ghost group
// - spikes should start at the top and accelerate slowly
// - letting the last ghost spawn the boss adds another dimension to player-positioning based on the spikes
// TODO 1: (badge: activate all spikes)
// orange:
// - placing way-blocks between orbs felt too clunky and not fluid enough
// - placing player on orb-line and move orb-line with shooting felt forced and made attacking the boss very unsatisfying
// - orb should spawn from a place where player is not shooting to, otherwise it will be hidden (so boss leaves on right, and orb spawns from left)
// - way-block direction should generally be the same as their spawning-location, to make it more comprehensible
// - in way-block phase, "wrong" block should come after correct block (same side) and have a maximum difference of 90 degrees
// - in way-block phase, block of 4 should only come with a break beforehand, otherwise it's too much
// - in fang phase, animations look best linear and without simultaneous movement, like a sliding puzzle (although not the same)
// - bullets in the last phase shouldn't be too dense, when the playing field is reduced it becomes increasingly difficult anyway
// red:
// - second corpse pattern can start later, to give player time to understand first swap-teleportation
// - using a cone-light to show generates was too easy, as player can just spin around all the time, so it made sense to switch to a short point-light
// - boss shouldn't attack himself in the last phase (even if it looks strange), because it's simply too much, focus should be on good side patterns
// magenta:
// - tried to split the screen again instead of rotating, and however I tried (different factors, movement, various axis), everything just sucks, the teleportation-aspect is just too unpredictable and watching two points is just too much
// - bullets between phases need to be removed, because of gravity-mechanic creating inconsistent transitions (gravity phase starts with bullets not affected or being affected and overwhelming player, and ends with bullets not affected anymore)
// - (old: direction plates should only be blue, because the red plates mix too much with the magenta background and red gravity waves)
// - similar to Messier boss, meteors should not reflect bullets
// - TODO 1: (badge: hit/desaturate all meteors)
// purple
// - all bullet types need to be present in some way
// - phases: attack from everywhere, from top with slower sub, from right with faster sub, still linear attack, moving circular attack
// - first wave (survival wave) should use the same movement pattern as the very first enemy group (though slight differences are allowed, but pattern should be identical)
// - view-bullets should come from the side (side-scroller), to differentiate stronger from the wave-bullets (vert-scroller)
// - quad bullet also need some very slow ones which stay long in the middle, to give additional obstacles when flying around boss (long enough)
// - triangle bullets need to be dense enough to make it hard to evade them across half of the screen
// blue:
// - bullet-walls in the first phase act as gates through which the player must pass at the right time
// - snow should not be kept into the final phase, because it is very difficult to see under the purple carpet of bullets and (unexpectedly) hinders evasive maneuvers
// - bullet-carpet with different directions at the same time (up to the right, down to the left) was extremely confusing to navigate, you missed holes and then couldn't dodge anymore
// - the blue ball should not be too fast, because the player will then no longer be able to control its movement precisely enough
// TODO 1: snow should be created with interpolation
// cyan:
// - cyan residue bullets cannot be used, because it blurs with the cyan background
// - bombs should be placed alternately straight and diagonally, even at the same height
// - time between charges during plate phase gives the player time to think and move, and the fast charge from the boss feels more intense
// - plate phase should start with a pattern, otherwise it is too easy
// - boss in plate phase should only fly along one axis to make his plate interaction more predictable
// - the last phase feels like swimming in water
// - the rotation of the boss and the arrow are like a clock to make the direction-change more predictable
// - grow bullets should not touch the center, the boss should always be vulnerable (even if just barely)
// green:
// - speed of the violet laser should start very slowly and only become fast later in order to divide this phase into two sub-phases with a smooth transition (fly free, get dragged)
// - at high laser speeds, the player must dodge bullets by moving along the laser
// - both lasers having different speeds looks interesting, but it negatively affects attacking the boss, making it very annoying
// - moving bullets during transition feel much more dynamic than frozen bullets, especially combined with the movement-interaction
// - boss should only charge from a single direction, otherwise player cannot plan his evasive maneuvers (which are hard in this phase), and can become very confused when boss suddenly appears from somewhere else than expected
// - bullets in shield phase should rather prevent the player from moving around, which is why they are slow and dense
// - player can fly in all directions at the shield corners, but that's okay (because it is logical), especially as long as player bullets are blocked normally
// - tried out free moving shields, and 45 degree shields, but the fixed labyrinth felt much more interesting in combination with the jump mechanic
// - 4x4 labyrinth was a bit too much, and the distance between player and boss for attacks was too short, even with a lower bullet density than now
// white:
// - boss should end with the final bullet-wave, upcoming events should not count to the time-bonus, and should not be disturbed with the time-bonus popup
// - background should not be too bright, otherwise bullets become harder to see
// TODO 1: add documentation for individual bullet phases
// intro:
// - should just be a warm-up, not too heavy and not too long
// - boss should shoot permanently
// ****************************************************************
// counter identifier
#define SELECTED_HELPER (0u)
#define CHARGE_COUNT (1u)
#define JUMP_COUNT (2u)
#define GHOST_ACTIVE (3u)
#define GHOST_TARGET (4u)
#define RUSH_COUNT (5u)
#define EVADE_COUNT (6u)
#define TELEPORT_COUNT (7u)
#define FANG_DATA (8u)
#define PATH_COUNT (9u)
#define SIDE_COUNT (10u)
#define MOLE_COUNT (11u)
#define QUICK_SHOT (12u)
#define FRAGMENT_PHASE (13u)
// ****************************************************************
// vector identifier
#define HELPER_DATA (0u)
#define LASER_ROTA (1u)
#define CHARGE_SPEED (2u)
#define JUMP_TARGET (3u)
#define SHOOT_TARGET (4u)
#define SPIKE_TIME (5u)
#define RUTILUS_ROTA (6u)
#define CALOR_ROTA (7u)
#define MOVE_VALUE (8u)
#define SHOT_TARGET (9u)
#define FINAL_ROTA (10u)
#define FINAL_PUSH (11u)
// ****************************************************************
// constructor
cProjectOneBoss::cProjectOneBoss()noexcept
: m_vRoadsignPos (coreVector2(0.0f,0.0f))
, m_fRoadsignTime (0.0f)
, m_fSmoothThrust (0.0f)
, m_vOldDir (coreVector2(0.0f,-1.0f))
, m_fArrowValue (0.0f)
, m_iHelperState (0u)
, m_vLevelColor (cProjectOneBoss::Color2)
, m_fAnimation (0.0f)
, m_fChromaValue (0.0f)
, m_fChromaSpeed (1.0f)
, m_fWaveValue (1.0f)
, m_vColorFrom (DARK_COLOR_DEFAULT)
, m_vColorTo (DARK_COLOR_DEFAULT)
, m_fPatternValue (0.0f)
, m_fPatternStrength (0.0f)
, m_iPatternType (0u)
, m_bDead (false)
, m_fFangTime (0.0f)
, m_iSlowdown (0u)
, m_fPushForce (0.0f)
, m_vPushDir (coreVector2(1.0f,-1.0f).Normalized())
, m_fPearlFlash (0.0f)
, m_fPlateTime (0.0f)
, m_iMeteorDir (0u)
, m_iBulletTick (0u)
, m_fGameAngle (0.0f)
, m_vGlobalDir (coreVector2(0.0f,1.0f))
, m_vBoulderDir (coreVector2(0.0f,1.0f))
, m_fArrowRota (0.0f)
, m_fFinalValue (0.0f)
, m_fFinalLerp (0.0f)
{
// load object resources
this->DefineModelHigh("ship_projectone_high.md3");
this->DefineModelLow ("ship_projectone_low.md3");
this->DefineVolume ("ship_projectone_volume.md3");
this->DefineTexture (0u, "ship_player.png");
// set object properties
this->SetSize(coreVector3(1.0f,1.0f,1.0f) * 1.5f);
this->SetCollisionModifier(coreVector3(1.0f,1.0f,1.0f) * PROJECTONE_COLL_SCALE);
// configure the boss
this->Configure(1, COLOR_SHIP_GREY);
this->AddStatus(ENEMY_STATUS_SECRET);
//
PHASE_HEALTH_GOAL({0})
//
constexpr coreVector3 avColor[] =
{
COLOR_ENERGY_YELLOW,
COLOR_ENERGY_ORANGE,
COLOR_ENERGY_RED,
COLOR_ENERGY_MAGENTA,
COLOR_ENERGY_PURPLE,
COLOR_ENERGY_BLUE,
COLOR_ENERGY_CYAN,
COLOR_ENERGY_GREEN
};
for(coreUintW i = 0u; i < PROJECTONE_SHIELDS; ++i)
{
m_aShield[i].DefineModelHigh("object_sphere.md3");
m_aShield[i].DefineModelLow ("object_sphere.md3");
m_aShield[i].DefineTexture (0u, "effect_energy.png");
m_aShield[i].DefineProgram ("effect_energy_blink_flat_spheric_program");
m_aShield[i].SetTexSize (coreVector2(1.0f,1.0f) * 4.0f);
m_aShield[i].Configure (1000, avColor[i]);
m_aShield[i].AddStatus (ENEMY_STATUS_ENERGY | ENEMY_STATUS_BOTTOM | ENEMY_STATUS_IMMORTAL | ENEMY_STATUS_FLAT);
}
//
for(coreUintW i = 0u; i < PROJECTONE_CLONES; ++i)
{
m_aClone[i].DefineModelHigh (this->GetModelHigh());
m_aClone[i].DefineModelLow (this->GetModelLow ());
m_aClone[i].DefineVolume (this->GetVolume ());
m_aClone[i].DefineTexture (0u, this->GetTexture(0u));
m_aClone[i].SetSize (this->GetSize());
m_aClone[i].SetCollisionModifier(coreVector3(1.0f,1.0f,1.0f) * 5.0f);
m_aClone[i].Configure (1, COLOR_SHIP_GREY);
m_aClone[i].AddStatus (ENEMY_STATUS_IMMORTAL | ENEMY_STATUS_GHOST | ENEMY_STATUS_WORTHLESS);
}
//
for(coreUintW i = 0u; i < PROJECTONE_FRAGMENTS; ++i)
{
m_aFragment[i].DefineModel (PRINT("fragment_%02zu.md3", g_aFragmentData[i].iIndex));
m_aFragment[i].DefineTexture(0u, "default_white.webp");
m_aFragment[i].DefineProgram("effect_energy_program");
m_aFragment[i].SetColor3 (COLOR_ENERGY_WHITE * 0.05f);
m_aFragment[i].SetTexSize (coreVector2(4.0f,4.0f));
m_aFragment[i].SetEnabled (CORE_OBJECT_ENABLE_NOTHING);
}
m_Roadsign.DefineModel ("object_arrow_short.md3");
m_Roadsign.DefineTexture(0u, "effect_energy.png");
m_Roadsign.DefineProgram("effect_energy_flat_invert_program");
m_Roadsign.SetSize (coreVector3(1.0f,1.0f,1.0f) * 2.2f);
m_Roadsign.SetColor3 (COLOR_ENERGY_CYAN);
m_Roadsign.SetTexSize (coreVector2(1.0f,1.0f) * 0.4f);
m_Roadsign.SetEnabled (CORE_OBJECT_ENABLE_NOTHING);
//
m_Range.DefineModel ("object_penta_top.md3");
m_Range.DefineTexture(0u, "effect_energy.png");
m_Range.DefineProgram("effect_energy_flat_invert_program");
m_Range.SetAlpha (0.0f);
m_Range.SetTexSize (coreVector2(0.1f,0.1f));
m_Range.SetEnabled (CORE_OBJECT_ENABLE_NOTHING);
//
m_Arrow.DefineModel ("bullet_cone.md3");
m_Arrow.DefineTexture(0u, "effect_energy.png");
m_Arrow.DefineProgram("effect_energy_flat_invert_program");
m_Arrow.SetAlpha (0.0f);
m_Arrow.SetTexSize (coreVector2(4.0f,1.0f) * 0.2f);
m_Arrow.SetEnabled (CORE_OBJECT_ENABLE_NOTHING);
//
m_Wind.DefineModel ("object_sphere.md3");
m_Wind.DefineTexture(0u, "effect_energy.png");
m_Wind.DefineProgram("effect_energy_flat_direct_program");
m_Wind.SetDirection (coreVector3(0.0f,-1.0f,0.0f));
m_Wind.SetAlpha (0.0f);
m_Wind.SetTexSize (coreVector2(1.0f,5.0f));
m_Wind.SetEnabled (CORE_OBJECT_ENABLE_NOTHING);
//
m_Bubble.DefineModel ("object_penta_top.md3");
m_Bubble.DefineTexture(0u, "effect_energy.png");
m_Bubble.DefineProgram("effect_energy_flat_spheric_program");
m_Bubble.SetColor4 (coreVector4(COLOR_ENERGY_WHITE * 0.6f, 0.0f));
m_Bubble.SetTexSize (coreVector2(0.5f,0.5f));
m_Bubble.SetEnabled (CORE_OBJECT_ENABLE_NOTHING);
//
m_Exhaust.DefineModel ("object_tube.md3");
m_Exhaust.DefineTexture(0u, "effect_energy.png");
m_Exhaust.DefineProgram("effect_energy_direct_program");
m_Exhaust.SetDirection (this->GetDirection());
m_Exhaust.SetAlpha (0.7f);
m_Exhaust.SetTexSize (coreVector2(0.5f,0.25f));
m_Exhaust.SetEnabled (CORE_OBJECT_ENABLE_NOTHING);
//
m_HelperPath.Reserve(3u);
m_HelperPath.AddNode(coreVector2(0.0f,0.0f), coreVector2( 0.0f, 1.0f));
m_HelperPath.AddNode(coreVector2(0.5f,0.5f), coreVector2( 1.0f,-1.0f).Normalized());
m_HelperPath.AddNode(coreVector2(0.0f,0.0f), coreVector2(-1.0f, 0.0f), 2.5f);
m_HelperPath.Refine();
//
m_pNightmareSound = Core::Manager::Resource->Get<coreSound>("effect_nightmare.wav");
//
m_aPurplePath[0].Reserve(2u);
m_aPurplePath[0].AddNode(coreVector2(-0.4f, 1.3f), coreVector2(0.0f,-1.0f));
m_aPurplePath[0].AddNode(coreVector2( 0.4f,-1.3f), coreVector2(0.0f,-1.0f));
m_aPurplePath[0].Refine();
//
m_aPurplePath[1].Reserve(2u);
m_aPurplePath[1].AddNode(coreVector2(-1.3f,0.8f), coreVector2(1.0f,0.0f));
m_aPurplePath[1].AddNode(coreVector2( 1.3f,0.0f), coreVector2(1.0f,0.0f));
m_aPurplePath[1].Refine();
}
// ****************************************************************
// destructor
cProjectOneBoss::~cProjectOneBoss()
{
//
this->Kill(false); // TODO 1: kill(false) could be dangerous on all bosses, e.g. inner-mission is already gone
//
for(coreUintW i = 0u; i < PROJECTONE_FRAGMENTS; ++i) this->__DisableFragment(i, false);
this->__DisableRoadsign(false);
}
// ****************************************************************
//
void cProjectOneBoss::CalcColor(const coreUintW iIndex, coreVector3* OUTPUT pvEnergyColor, coreVector3* OUTPUT pvBlockColor, coreVector3* OUTPUT pvLevelColor, coreVector3* OUTPUT pvBackColor, coreVector3* OUTPUT pvBackColor2, coreVector3* OUTPUT pvLedColor)
{
ASSERT(pvEnergyColor && pvBlockColor && pvLevelColor && pvBackColor && pvBackColor2 && pvLedColor)
switch(iIndex)
{
default: UNREACHABLE
case 0u: (*pvEnergyColor) = COLOR_PLAYER_YELLOW; (*pvBlockColor) = LERP(coreVector3(1.0f,1.0f,1.0f), COLOR_MENU_YELLOW, 1.0f); (*pvLevelColor) = COLOR_MENU_YELLOW; (*pvBackColor) = cDesertBackground ::Color; (*pvBackColor2) = cDesertBackground ::Color2; (*pvLedColor) = COLOR_LED_YELLOW; break;
case 1u: (*pvEnergyColor) = COLOR_PLAYER_ORANGE; (*pvBlockColor) = LERP(coreVector3(1.0f,1.0f,1.0f), COLOR_MENU_ORANGE, 1.0f); (*pvLevelColor) = COLOR_MENU_ORANGE; (*pvBackColor) = cVolcanoBackground::Color; (*pvBackColor2) = cVolcanoBackground::Color2; (*pvLedColor) = COLOR_LED_ORANGE; break;
case 2u: (*pvEnergyColor) = COLOR_PLAYER_RED; (*pvBlockColor) = LERP(coreVector3(1.0f,1.0f,1.0f), COLOR_MENU_RED, 0.9f); (*pvLevelColor) = COLOR_MENU_RED; (*pvBackColor) = cMossBackground ::Color; (*pvBackColor2) = cMossBackground ::Color2; (*pvLedColor) = COLOR_LED_RED; break;
case 3u: (*pvEnergyColor) = COLOR_PLAYER_MAGENTA; (*pvBlockColor) = LERP(coreVector3(1.0f,1.0f,1.0f), COLOR_MENU_MAGENTA, 0.9f); (*pvLevelColor) = COLOR_MENU_MAGENTA; (*pvBackColor) = cSpaceBackground ::Color; (*pvBackColor2) = cSpaceBackground ::Color2; (*pvLedColor) = COLOR_LED_MAGENTA; break;
case 4u: (*pvEnergyColor) = COLOR_PLAYER_PURPLE; (*pvBlockColor) = LERP(coreVector3(1.0f,1.0f,1.0f), COLOR_MENU_PURPLE, 1.0f); (*pvLevelColor) = COLOR_MENU_PURPLE; (*pvBackColor) = cCloudBackground ::Color; (*pvBackColor2) = cCloudBackground ::Color2; (*pvLedColor) = COLOR_LED_PURPLE; break;
case 5u: (*pvEnergyColor) = COLOR_PLAYER_BLUE; (*pvBlockColor) = LERP(coreVector3(1.0f,1.0f,1.0f), COLOR_MENU_BLUE, 1.0f); (*pvLevelColor) = COLOR_MENU_BLUE; (*pvBackColor) = cSnowBackground ::Color; (*pvBackColor2) = cSnowBackground ::Color2; (*pvLedColor) = COLOR_LED_BLUE; break;
case 6u: (*pvEnergyColor) = COLOR_PLAYER_CYAN; (*pvBlockColor) = LERP(coreVector3(1.0f,1.0f,1.0f), COLOR_MENU_CYAN, 1.0f); (*pvLevelColor) = COLOR_MENU_CYAN; (*pvBackColor) = cSeaBackground ::Color; (*pvBackColor2) = cSeaBackground ::Color2; (*pvLedColor) = COLOR_LED_CYAN; break;
case 7u: (*pvEnergyColor) = COLOR_PLAYER_GREEN; (*pvBlockColor) = LERP(coreVector3(1.0f,1.0f,1.0f), COLOR_MENU_GREEN, 1.0f); (*pvLevelColor) = COLOR_MENU_GREEN; (*pvBackColor) = cGrassBackground ::Color; (*pvBackColor2) = cGrassBackground ::Color2; (*pvLedColor) = COLOR_LED_GREEN; break;
case 8u: (*pvEnergyColor) = COLOR_PLAYER_WHITE; (*pvBlockColor) = DARK_COLOR_DEFAULT; (*pvLevelColor) = COLOR_MENU_WHITE; (*pvBackColor) = cDarkBackground ::Color; (*pvBackColor2) = cDarkBackground ::Color2; (*pvLedColor) = COLOR_LED_WHITE; break;
case 9u: (*pvEnergyColor) = COLOR_PLAYER_WHITE; (*pvBlockColor) = DARK_COLOR_DEFAULT; (*pvLevelColor) = COLOR_MENU_WHITE; (*pvBackColor) = cDarkBackground ::Color; (*pvBackColor2) = cDarkBackground ::Color2; (*pvLedColor) = COLOR_LED_WHITE; break;
}
}
// ****************************************************************
//
void cProjectOneBoss::CalcColorLerp(const coreFloat fValue, coreVector3* OUTPUT pvEnergyColor, coreVector3* OUTPUT pvBlockColor, coreVector3* OUTPUT pvLevelColor, coreVector3* OUTPUT pvBackColor, coreVector3* OUTPUT pvBackColor2, coreVector3* OUTPUT pvLedColor)
{
ASSERT(fValue >= 0.0f)
const coreUintW iFrom = (F_TO_UI(fValue)) % 8u;
const coreUintW iTo = (F_TO_UI(fValue) + 1u) % 8u;
coreVector3 vEnergyColorA, vBlockColorA, vLevelColorA, vBackColorA, vBackColor2A, vLedColorA;
cProjectOneBoss::CalcColor(iFrom, &vEnergyColorA, &vBlockColorA, &vLevelColorA, &vBackColorA, &vBackColor2A, &vLedColorA);
coreVector3 vEnergyColorB, vBlockColorB, vLevelColorB, vBackColorB, vBackColor2B, vLedColorB;
cProjectOneBoss::CalcColor(iTo, &vEnergyColorB, &vBlockColorB, &vLevelColorB, &vBackColorB, &vBackColor2B, &vLedColorB);
(*pvEnergyColor) = LERP(vEnergyColorA, vEnergyColorB, FRACT(fValue));
(*pvBlockColor) = LERP(vBlockColorA, vBlockColorB, FRACT(fValue));
(*pvLevelColor) = LERP(vLevelColorA, vLevelColorB, FRACT(fValue));
(*pvBackColor) = LERP(vBackColorA, vBackColorB, FRACT(fValue));
(*pvBackColor2) = LERP(vBackColor2A, vBackColor2B, FRACT(fValue));
(*pvLedColor) = LERP(vLedColorA, vLedColorB, FRACT(fValue));
}
// ****************************************************************
//
void cProjectOneBoss::__ResurrectOwn()
{
//
this->__SwitchHealth(9u);
this->__SwitchColor (7u, false, false);
//
this->_ResurrectBoss();
//
g_pGame->GetCurMission()->SetDelay(true);
//
const cDataTable* pTable = g_pGame->GetPlayer(0u)->GetDataTable();
const coreBool bFromBeginning = pTable->GetMedalSegment(MISSION_INTRO, 0u) != MEDAL_NONE;
const coreUint16 iContinuesUsed = pTable->GetCounterTotal().iContinuesUsed;
const coreUint8* piShield = g_pGame->GetOptions().aiShield;
const coreBool bOneColorClear = bFromBeginning && !iContinuesUsed && std::all_of(piShield, piShield + g_pGame->GetNumPlayers(), [](const coreUint8 A) {return !A;});
//
const coreUint8* piFragment = REPLAY_WRAP_PROGRESS_FRAGMENT;
m_aiCounter[FRAGMENT_PHASE] = (std::all_of(piFragment, piFragment + PROJECTONE_FRAGMENTS, [](const coreUint8 A) {return A;}) || bOneColorClear) ? 1 : 0;
//
for(coreUintW i = 0u; i < PROJECTONE_FRAGMENTS; ++i)
{
constexpr coreUintW aiOrder[] = {3u, 5u, 7u, 4u, 0u, 6u, 2u, 1u};
STATIC_ASSERT(ARRAY_SIZE(aiOrder) == PROJECTONE_FRAGMENTS)
if(piFragment[aiOrder[i]]) ADD_BIT(m_iHelperHit, i)
}
}
// ****************************************************************
//
void cProjectOneBoss::__KillOwn(const coreBool bAnimated)
{
//
for(coreUintW i = 0u; i < PROJECTONE_FRAGMENTS; ++i) this->__DisableFragment(i, bAnimated);
this->__DisableRoadsign(bAnimated);
//
for(coreUintW i = 0u; i < PROJECTONE_SHIELDS; ++i)
m_aShield[i].Kill(bAnimated);
//
for(coreUintW i = 0u; i < PROJECTONE_CLONES; ++i)
m_aClone[i].Kill(bAnimated);
//
this->__EndFeeling();
//
this->__DisableRange();
this->__DisableArrow();
this->__DisableWind();
this->__DisableBubble();
this->__DisableExhaust();
//
m_fSmoothThrust = 0.0f;
//
m_vOldDir = coreVector2(0.0f,-1.0f);
m_fArrowValue = 0.0f;
//
if(m_pNightmareSound->EnableRef(this)) m_pNightmareSound->Stop();
//
this->__EndMission(bAnimated, false);
}
// ****************************************************************
//
void cProjectOneBoss::__RenderOwnUnder()
{
if(!HAS_FLAG(m_iStatus, ENEMY_STATUS_HIDDEN))
{
DEPTH_PUSH
//
g_pOutline->GetStyle(OUTLINE_STYLE_FLAT_FULL)->ApplyObject(&m_Bubble);
//
m_Bubble .Render();
m_Wind .Render();
m_Exhaust.Render();
}
}
// ****************************************************************
//
void cProjectOneBoss::__RenderOwnTop()
{
if(!HAS_FLAG(m_iStatus, ENEMY_STATUS_HIDDEN))
{
DEPTH_PUSH
//
g_pOutline->GetStyle(OUTLINE_STYLE_FLAT_FULL)->ApplyObject(&m_Range);
g_pOutline->GetStyle(OUTLINE_STYLE_FLAT_FULL)->ApplyObject(&m_Arrow);
//
m_Arrow.Render(); // # swapped
m_Range.Render();
//
m_Roadsign.Render();
g_pOutline->GetStyle(OUTLINE_STYLE_FLAT_FULL)->ApplyObject(&m_Roadsign);
}
if(std::any_of(m_aFragment, m_aFragment + PROJECTONE_FRAGMENTS, [](const coreObject3D& A) {return A.IsEnabled(CORE_OBJECT_ENABLE_RENDER);}))
{
DEPTH_PUSH
//
for(coreUintW i = 0u; i < PROJECTONE_FRAGMENTS; ++i) m_aFragment[i].Render();
for(coreUintW i = 0u; i < PROJECTONE_FRAGMENTS; ++i) g_pOutline->GetStyle(OUTLINE_STYLE_LIGHT)->ApplyObject(&m_aFragment[i]);
}
}
// ****************************************************************
//
void cProjectOneBoss::__MoveOwn()
{
cDarkBackground* pBackground = d_cast<cDarkBackground*>(g_pEnvironment->GetBackground());
//
this->_UpdateBoss();
//
m_fAnimation.UpdateMod(1.0f, 20.0f);
//
cPlayer* pOther = g_pGame->GetPlayer(1u);
STATIC_ASSERT(GAME_PLAYERS == 2u)
coreFloat fThrustOverride = 0.0f;
// ################################################################
//
if(m_iPhase == 0u)
{
if(PHASE_BEGINNING2)
{
g_pEnvironment->SetTargetSpeed(1.2f, 0.2f);
this->AddStatus(ENEMY_STATUS_GHOST);
}
for(coreUintW i = 0u; i < PROJECTONE_SHIELDS; ++i)
{
cHelper* pHelper = g_pGame->GetHelper(ELEMENT_YELLOW + i);
if(PHASE_BEGINNING2) pHelper->Resurrect(false);
const coreFloat fTime = CLAMP01((m_fPhaseTime - I_TO_F(i) * 0.2f) * 0.7f);
coreFloat fSide;
switch(i % 4u)
{
default: UNREACHABLE
case 0u: fSide = -0.45f; break;
case 1u: fSide = 0.85f; break;
case 2u: fSide = -0.85f; break;
case 3u: fSide = 0.45f; break;
}
const coreVector2 vPos = coreVector2(fSide * 0.9f * LERPH3(1.0f, 0.8f, fTime), LERPH3(-1.2f, 1.3f, fTime)) * FOREGROUND_AREA;
pHelper->SetPosition(coreVector3(vPos, 0.0f));
if((i == PROJECTONE_SHIELDS - 1u) && (fTime >= 1.0f))
PHASE_CHANGE_INC
}
PHASE_CONTROL_TIMER(0u, 0.1f, LERP_LINEAR)
{
if(PHASE_BEGINNING)
{
this->SetPosition(coreVector3(0.0f,-1.5f,0.0f) * FOREGROUND_AREA3);
g_pSpecialEffects->PlaySound(this->GetPosition(), 1.0f, 0.8f, SOUND_EFFECT_FLY);
}
const coreFloat fReal = MAX(fTime * 10.0f, 0.0f);
const coreFloat fPos = MIN(this->GetPosition().y + 90.0f * fReal * TIME, 1000.0f);
const coreVector2 vDir = coreVector2::Direction(LERPS(0.0f, 2.0f*PI, 0.6f * fReal));
this->SetPosition (coreVector3(this->GetPosition().x, fPos, this->GetPosition().z));
this->SetDirection (coreVector3(0.0f,1.0f,0.0f));
this->SetOrientation(coreVector3(vDir.x, 0.0f, vDir.y));
fThrustOverride = (fReal < 0.2f) ? LERPB(0.0f, 0.7f, fReal / 0.2f) : LERPB(0.7f, 0.3f, fReal - 0.2f);
});
}
// ################################################################
//
else if(m_iPhase == 1u)
{
PHASE_CONTROL_PAUSE(0u, 1.0f)
{
PHASE_CHANGE_INC
});
}
// ################################################################
//
else if(m_iPhase == 2u)
{
if(PHASE_BEGINNING2)
{
for(coreUintW i = 0u; i < PROJECTONE_SHIELDS; ++i)
g_pGame->GetHelper(ELEMENT_YELLOW + i)->Kill(false);
this->__StartFeeling();
this->SetDirection (coreVector3(0.0f,-1.0f,0.0f));
this->SetOrientation(coreVector3(0.0f, 0.0f,1.0f));
}
PHASE_CONTROL_TIMER(0u, 0.4f, LERP_BREAK)
{
this->DefaultMoveLerp(coreVector2(0.0f,1.3f), coreVector2(0.0f,0.6f), fTime);
if(PHASE_TIME_POINT(0.1f))
this->_StartBoss();
if(PHASE_FINISHED)
PHASE_CHANGE_INC
});
}
// ################################################################
//
else if(m_iPhase == 3u)
{
PHASE_CONTROL_PAUSE(0u, 0.7f)
{
PHASE_CHANGE_TO(30u)
//if(DEFINED(_CORE_DEBUG_)) PHASE_CHANGE_TO(40u)
});
}
// ################################################################
// return from color phase
else if(m_iPhase == 10u)
{
PHASE_CONTROL_PAUSE(0u, 0.8f)
{
PHASE_CHANGE_TO(m_bDead ? 40u : 32u)
});
}
// ################################################################
// return from white phase
else if(m_iPhase == 11u)
{
if(PHASE_BEGINNING2)
{
m_bDead = true;
m_fWaveValue = 1.1f;
this->__EndFeeling();
this->AddStatus(ENEMY_STATUS_GHOST_PLAYER | ENEMY_STATUS_WORTHLESS); // # after EndFeeling
this->__DisableRange();
this->__DisableWind ();
g_pEnvironment->SetTargetSpeed(0.0f, 1.0f);
}
if(PHASE_MAINTIME_POINT(6.0f))
{
if(m_aiCounter[FRAGMENT_PHASE] == 1)
{
m_aiCounter[FRAGMENT_PHASE] = 2;
this->_CreateFragment(8u);
g_pSpecialEffects->MacroExplosionDarkBig(this->GetPosition());
g_pSpecialEffects->PlaySound(this->GetPosition(), 1.0f, 1.0f, SOUND_ENEMY_EXPLOSION_10);
g_pSpecialEffects->RumblePlayer(NULL, SPECIAL_RUMBLE_SMALL, 250u);
if(g_pGame->IsMulti())
{
pOther->AddStatus(PLAYER_STATUS_NO_INPUT_ALL);
const coreVector2 vDiff = pOther->GetPosition().xy() - this->GetPosition().xy();
m_avVector[FINAL_PUSH].xy(vDiff.IsNull() ? coreVector2(0.0f,-1.0f) : vDiff.Normalized());
m_avVector[FINAL_PUSH].z = pOther->GetDirection().xy().Angle();
g_pSpecialEffects->CreateBlowColor(pOther->GetPosition(), coreVector3(m_avVector[FINAL_PUSH].xy(), 0.0f), SPECIAL_BLOW_SMALL, COLOR_ENERGY_WHITE * 0.9f);
}
if(g_pGame->GetKind() == GAME_KIND_ALL)
{
this->AddStatus(ENEMY_STATUS_INVINCIBLE);
}
}
}
cItem* pItem = g_pGame->GetItemManager()->GetNumItems() ? g_pGame->GetItemManager()->GetItem(0u) : NULL;
if(m_aiCounter[FRAGMENT_PHASE] == 2)
{
PHASE_CONTROL_TIMER(0u, 1.0f, LERP_BREAK)
{
this->DefaultMoveLerp(m_vLastPosition, coreVector2(-0.4f,0.3f), fTime);
if(pItem) pItem->SetPosition(this->GetPosition().InvertedX());
});
}
if(pItem && HAS_FLAG(pItem->GetStatus(), ITEM_STATUS_COLLECTED))
{
PHASE_CHANGE_INC
g_pGame->GetPlayer(0u)->AddStatus(PLAYER_STATUS_NO_INPUT_ALL | PLAYER_STATUS_KEEP_RANGE);
g_pGame->GetInterface()->SetVisible(false);
d_cast<cAterMission*>(g_pGame->GetCurMission())->LaunchSecret();
}
else if(!this->GetCurHealth()) // instead of ReachedDeath
{
this->Kill(true);
g_pMenu->PreventSaveText();
g_pSpecialEffects->CreateExplosion (this->GetPosition());
g_pSpecialEffects->CreateSplashDark(this->GetPosition(), 200.0f, 400u, true);
g_pSpecialEffects->PlaySound (this->GetPosition(), 1.0f, 1.0f, SOUND_ENEMY_EXPLOSION_11);
g_pSpecialEffects->PlaySound (this->GetPosition(), 1.2f, 0.6f, SOUND_EFFECT_SHAKE_02);
g_pSpecialEffects->SlowScreen(4.0f);
g_pGame->GetItemManager()->ClearItems(true);
if(m_aiCounter[FRAGMENT_PHASE])
{
g_pGame->ForEachPlayerAll([](cPlayer* OUTPUT pPlayer, const coreUintW i)
{
pPlayer->ActivateNormalShading();
g_pSpecialEffects->CreateSplashDark(pPlayer->GetPosition(), SPECIAL_SPLASH_SMALL);
});
}
if(pOther->HasStatus(PLAYER_STATUS_NO_INPUT_ALL)) pOther->SetPosition(coreVector3(HIDDEN_POS, 0.0f));
}
}
// ################################################################
//
else if(m_iPhase == 12u)
{
if(PHASE_BEGINNING2)
{
for(coreUintW i = 0u; i < PROJECTONE_FRAGMENTS; ++i)
this->__EnableFragment(i);
}
if(PHASE_MAINTIME_POINT(INTERFACE_FRAGMENT_DURATION_2))
{
m_pNightmareSound->PlayRelative(this, 0.5f, 1.0f, false, SOUND_EFFECT);
}
cPlayer* pPlayer = g_pGame->GetPlayer(0u);
coreBool bFinished = true;
for(coreUintW i = 0u; i < PROJECTONE_FRAGMENTS; ++i)
{
if(!m_aFragment[i].IsEnabled(CORE_OBJECT_ENABLE_MOVE)) continue;
bFinished = false;
const coreFloat fTime = CLAMP01((m_fPhaseTime - INTERFACE_FRAGMENT_DURATION_EXT - I_TO_F(g_aiFragmentOrder[i]) * 0.3f) * 0.7f);
const coreVector2 vDir2 = FRAGMENT_DIRECTION;
const coreVector2 vPos2 = MapToAxisInv(FRAGMENT_POSITION(i), vDir2) * FOREGROUND_AREA;
const coreVector2 vPos = pPlayer->GetPosition().xy() + vPos2 * LERPBR(6.0f, 0.0f, fTime);
const coreFloat fScale = LERPBR(3.0f, 1.5f, fTime);
m_aFragment[i].SetPosition(coreVector3(vPos, 0.0f));
m_aFragment[i].SetSize (coreVector3(1.0f,1.0f,1.0f) * fScale);
if(fTime >= 1.0f) this->__DisableFragment(i, true);
}
if(bFinished)
{
PHASE_CHANGE_INC
g_pSpecialEffects->CreateExplosion (pPlayer->GetPosition());
g_pSpecialEffects->CreateSplashDark(pPlayer->GetPosition(), 200.0f, 400u, true);
g_pSpecialEffects->PlaySound (pPlayer->GetPosition(), 1.0f, 1.0f, SOUND_ENEMY_EXPLOSION_11);
g_pSpecialEffects->PlaySound (pPlayer->GetPosition(), 1.2f, 0.6f, SOUND_EFFECT_SHAKE_02);
g_pSpecialEffects->SlowScreen(4.0f);
pPlayer->SetPosition(coreVector3(HIDDEN_POS, 0.0f));
pPlayer->RemoveStatus(PLAYER_STATUS_KEEP_RANGE);
if(m_pNightmareSound->EnableRef(this)) m_pNightmareSound->Stop();
}
}
// ################################################################
//
else if(m_iPhase == 13u)
{
PHASE_CONTROL_PAUSE(0u, 0.3f)
{
PHASE_CHANGE_INC
});
}
// ################################################################
//
else if(m_iPhase == 14u)
{
if(PHASE_BEGINNING2)
{
for(coreUintW i = 0u; i < PROJECTONE_SHIELDS; ++i)
{
g_pGame->GetHelper(ELEMENT_YELLOW + i)->AddStatus(HELPER_STATUS_BOTTOM);
g_pGame->GetHelper(ELEMENT_YELLOW + i)->Resurrect(false);
}
if(g_pGame->IsMulti())
{
g_pGame->GetHelper(ELEMENT_WHITE)->AddStatus(HELPER_STATUS_BOTTOM);
g_pGame->GetHelper(ELEMENT_WHITE)->Resurrect(false);
}
m_avVector[FINAL_PUSH].xy(coreVector2(0.0f,0.0f));
if(g_pGame->IsMulti())
{
pOther->DisableWind();
}
}
const coreFloat fSide = g_pGame->IsMulti() ? 10.0f : 0.0f;
const coreVector2 vTarget1 = coreVector2(-fSide, 0.0f);
const coreVector2 vTarget2 = coreVector2( fSide, 0.0f);
PHASE_CONTROL_TIMER(0u, 0.2f, LERP_SMOOTH)
{
this->DefaultMoveLerp(m_vLastPosition, vTarget1 / FOREGROUND_AREA, fTime);
if(g_pGame->IsMulti())
{
pOther->SetPosition (coreVector3(LERP(coreVector2(60.0f,-20.0f), vTarget2, fTime), 0.0f));
pOther->SetDirection (this->GetDirection().InvertedX());
pOther->SetOrientation(coreVector3(0.0f,0.0f,1.0f));
}
});
m_avVector[FINAL_ROTA].x += (m_fPhaseTime * 0.5f) * TIME;
const coreFloat fTime = m_fPhaseTime * 0.3f;
const coreFloat fSpeed = 0.5f + 2.5f * SIN(MIN1(fTime) * (1.0f*PI));
const coreFloat fSpawn = LERPB(FOREGROUND_AREA.x * 2.0f * SQRT2, 15.0f, MIN1(fTime)) - LERPS(0.0f, 15.0f, MIN1(fTime - 1.1f));
m_avVector[HELPER_DATA].z += fSpeed * TIME;
for(coreUintW i = 0u; i < PROJECTONE_SHIELDS; ++i)
{
const coreVector2 vDir = coreVector2::Direction((2.0f*PI) * I_TO_F(i) / I_TO_F(PROJECTONE_SHIELDS) - m_avVector[HELPER_DATA].z);
const coreVector2 vPos = vTarget1 + vDir * fSpawn;
g_pGame->GetHelper(ELEMENT_YELLOW + i)->SetPosition(coreVector3(vPos, 0.0f));
}
if(g_pGame->IsMulti())
{
const coreVector2 vPos = vTarget2 + coreVector2(0.0f,1.0f) * fSpawn;
g_pGame->GetHelper(ELEMENT_WHITE)->SetPosition(coreVector3(vPos, 0.0f));
}
if(fSpawn <= 0.1f)
{
PHASE_CHANGE_INC
for(coreUintW i = 0u; i < PROJECTONE_SHIELDS; ++i)
{
g_pGame->GetHelper(ELEMENT_YELLOW + i)->Kill(false);
g_pGame->GetHelper(ELEMENT_YELLOW + i)->RemoveStatus(HELPER_STATUS_BOTTOM);
}
g_pGame->GetHelper(ELEMENT_WHITE)->Kill(false);
g_pGame->GetHelper(ELEMENT_WHITE)->RemoveStatus(HELPER_STATUS_BOTTOM);
g_pSpecialEffects->MacroExplosionColorBig(this->GetPosition(), COLOR_ENERGY_WHITE * 0.9f);
g_pSpecialEffects->CreateSplashColor(this->GetPosition(), 200.0f, 100u, COLOR_ENERGY_WHITE * 0.9f);
g_pSpecialEffects->PlaySound(this->GetPosition(), 1.0f, 1.0f, SOUND_ENEMY_EXPLOSION_08);
g_pSpecialEffects->PlaySound(this->GetPosition(), 1.0f, 1.0f, SOUND_EFFECT_SHAKE_02);
if(g_pGame->IsMulti())
{
g_pSpecialEffects->MacroExplosionColorBig(pOther->GetPosition(), COLOR_ENERGY_WHITE * 0.9f);
g_pSpecialEffects->CreateSplashColor(pOther->GetPosition(), 200.0f, 100u, COLOR_ENERGY_WHITE * 0.9f);
g_pSpecialEffects->PlaySound(pOther->GetPosition(), 1.0f, 1.0f, SOUND_ENEMY_EXPLOSION_08);
g_pSpecialEffects->PlaySound(pOther->GetPosition(), 1.0f, 1.0f, SOUND_EFFECT_SHAKE_02);
}
g_pSpecialEffects->RumblePlayer(NULL, SPECIAL_RUMBLE_BIG, 250u);
//this->__SwitchColor(9u, true, true);
//m_vColorFrom = m_vColorTo; // was overridden
d_cast<cAterMission*>(g_pGame->GetCurMission())->TransformPlayers();
cPlayer* pPlayer = g_pGame->GetPlayer(0u);
pPlayer->SetPosition (this->GetPosition());
pPlayer->SetDirection (coreVector3(0.0f,1.0f,0.0f));
pPlayer->SetOrientation(coreVector3(0.0f,0.0f,1.0f));
if(g_pGame->IsMulti())
{
pOther->SetDirection (coreVector3(0.0f,1.0f,0.0f));
pOther->SetOrientation(coreVector3(0.0f,0.0f,1.0f));
pOther->EnableWind();
}
this->AddStatus(ENEMY_STATUS_GHOST | ENEMY_STATUS_HIDDEN);
}
}
// ################################################################
//
else if(m_iPhase == 15u)
{
PHASE_CONTROL_PAUSE(0u, 0.25f)
{
this->Kill(false);
});
}
// ################################################################
//
else if(m_iPhase == 30u)
{
// # nothing
PHASE_CHANGE_INC
}
// ################################################################
//
else if(m_iPhase == 31u)
{
if(PHASE_BEGINNING2)
{
m_aiCounter[SELECTED_HELPER] = -1;
m_avVector [HELPER_DATA].z = 1.7f*PI;
g_pSpecialEffects->PlaySound(this->GetPosition(), 1.0f, 1.0f, SOUND_EFFECT_FLY);
}
PHASE_CONTROL_TIMER(0u, 0.3f, LERP_SMOOTH)
{
this->DefaultMoveLerp (m_vLastPosition, coreVector2(0.0f,0.0f), fTime);
this->DefaultOrientateLerp(0.0f*PI, 2.0f*PI, fTime);
});
for(coreUintW i = 0u; i < DARK_BLOCKS; ++i)
{
const coreFloat fBlockTime = CLAMP01(m_fPhaseTime * 0.6f - I_TO_F(i % 7u) / 6.0f);
const coreFloat fStartHeight = pBackground->GetStartHeight(i);
const coreFloat fNewHeight = fStartHeight * (1.0f + 1.0f * SIN(fBlockTime * (1.5f*PI)));
const coreFloat fLerp = STEP(-DARK_DETAIL * 1.5f, DARK_DETAIL * 1.5f, fNewHeight);
const coreVector3 vNewColor = LERP(0.1f, 1.0f, fLerp) * m_vColorTo;
pBackground->SetBlockHeight(i, fNewHeight);
pBackground->SetBlockColor (i, vNewColor);
}
const coreFloat fTime = MIN1(m_fPhaseTime * 0.3f);
const coreFloat fSpeed = 0.5f + 2.5f * SIN(fTime * (1.0f*PI));
const coreFloat fSpawn = LERPB(FOREGROUND_AREA.x * 1.25f * SQRT2, 15.0f, fTime);
const coreFloat fFade = LERPH3(0.0f, 1.0f, CLAMP01(m_fPhaseTime - (1.0f / 0.3f - 1.0f)));
const coreUintW iRotaCount = PROJECTONE_SHIELDS;
coreUintW iRotaNum = 0u;
m_avVector[HELPER_DATA].z += fSpeed * TIME;
for(coreUintW i = 0u; i < PROJECTONE_SHIELDS; ++i)
{
if(HAS_BIT(m_iHelperState, i)) continue;
cHelper* pHelper = g_pGame->GetHelper(ELEMENT_YELLOW + i);
cCustomEnemy* pShield = &m_aShield[i];
if(PHASE_MAINTIME_POINT(0.0f)) pHelper->Resurrect(false);
if(PHASE_MAINTIME_POINT(1.0f / 0.3f - 1.0f)) pShield->Resurrect();
const coreVector2 vDir = coreVector2::Direction((2.0f*PI) * I_TO_F(iRotaNum) * RCP(I_TO_F(iRotaCount)) + m_avVector[HELPER_DATA].z);
const coreVector2 vPos = vDir * fSpawn;
pHelper->SetPosition(coreVector3(vPos, 0.0f));
pShield->SetSize (fFade * coreVector3(5.0f,5.0f,5.0f));
pShield->SetAlpha(fFade);
if(!pShield->HasStatus(ENEMY_STATUS_DEAD) && (pShield->GetLostHealth() >= 50))
{
m_aiCounter[SELECTED_HELPER] = i;
m_avVector [HELPER_DATA].xy(vPos);
}
iRotaNum += 1u;
}
if(m_aiCounter[SELECTED_HELPER] >= 0)
{
PHASE_CHANGE_TO(33u)