]> git.mxchange.org Git - quix0rs-blobwars.git/blob - src/finalBattle.cpp
Use UNIX line endings everywhere.
[quix0rs-blobwars.git] / src / finalBattle.cpp
1 /*
2 Copyright (C) 2004 Parallel Realities
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20
21 #include "finalBattle.h"
22
23 void galdovMiniAttack();
24 void galdovFinalFlee1();
25 void blackDroidAttack();
26
27 // ************************ Black Droids for Part 2 *************************************
28
29 void blackDroidFire()
30 {       
31         (self->x < player.x) ? self->face = 0 : self->face = 1;
32         
33         if (!hasClearShot(self))
34                 return;
35         
36         self->setActionFinished(9);
37         self->setThinkTime(2);
38         self->think = &blackDroidFire;
39         
40         addBullet((Entity*)self, 0, 0);
41         
42         self->custom--;
43         if (self->custom == 0)
44         {
45                 self->think = &blackDroidAttack;
46         }
47 }
48
49 void blackDroidDie()
50 {
51         self->health--;
52         Math::removeBit(&self->flags, ENT_FLIES);
53         
54         if (self->health < -10)
55         {
56                 if ((self->health % 3) == 0)
57                 {
58                         addExplosion(self->x, self->y, 35, self);
59                         addSmokeAndFire(self, Math::rrand(-15, 15), Math::rrand(-15, 15), 2);
60                 }
61         }
62         
63         if (self->health <= -60)
64         {
65                 if ((Math::prand() % 2) == 0)
66                 {
67                         dropItems((int)self->x, (int)self->y);
68                         dropItems((int)self->x, (int)self->y);
69                 }
70                 else
71                 {
72                         addItem(100, "Red Keycard", (int)self->x, (int)self->y, "RedKeyCard", 240, 1, ENT_DYING, true);
73                 }
74                 self->active = false;
75                 self->place(9999, 9999);
76         }
77 }
78
79 void blackDroidChasePlayer()
80 {
81         self->think = &blackDroidAttack;
82         
83         (self->x < player.x) ? self->face = 0 : self->face = 1;
84         
85         float dx, dy;
86         
87         Math::calculateSlope(player.x, player.y, self->x, self->y, &dx, &dy);
88         
89         self->dx = (dx * 2);
90         self->dy = (dy * 2);
91         
92         self->setThinkTime(10);
93         self->setActionFinished(10);
94 }
95
96 void blackDroidMoveRandom()
97 {
98         (self->x < player.x) ? self->face = 0 : self->face = 1;
99         
100         self->think = &blackDroidAttack;
101         
102         self->dx = Math::rrand(-200, 200);
103         self->dy = Math::rrand(-200, 200);
104
105         self->dx *= 0.01;
106         self->dy *= 0.01;
107
108         self->setThinkTime(2);
109         self->setActionFinished(Math::rrand(60, 90));
110 }
111
112 void blackDroidAttack()
113 {
114         self->think = blackDroidAttack;
115         self->setThinkTime(2);
116         self->setActionFinished(2);
117         
118         int r = Math::prand() % 15;
119         
120         if (r <= 2)
121         {
122                 self->think = &blackDroidFire;
123                 self->setThinkTime(2);
124                 self->setActionFinished(2);
125                 self->custom = Math::rrand(2, 4) * game.skill;
126         }
127         else if (r < 5)
128         {
129                 self->think = &blackDroidChasePlayer;
130                 self->setThinkTime(2);
131                 self->setActionFinished(2);
132         }
133         else
134         {
135                 self->think = &blackDroidMoveRandom;
136                 self->setThinkTime(2);
137                 self->setActionFinished(2);
138         }
139 }
140
141 void galdovInitBlackDroids()
142 {
143         for (int i = 6 ; i < 10 ; i++)
144         {
145                 if (map.boss[i] == NULL)
146                 {
147                         map.boss[i] = new Boss();
148                 }
149                 debug(("BlackDroid %d init\n", i));
150                 strcpy(map.boss[i]->name, "BlackDrod");
151                 map.boss[i]->health = -90;
152                 map.boss[i]->maxHealth = -90;
153                 map.boss[i]->setSprites(graphics.getSprite("BlackDroidRight", true), graphics.getSprite("BlackDroidLeft", true), graphics.getSprite("BlackDroidDie", true));
154                 map.boss[i]->currentWeapon = &weapon[WP_PLASMARIFLE];
155                 map.boss[i]->face = 0;
156                 map.boss[i]->active = false;
157                 map.boss[i]->place(9999, 9999);
158                 map.boss[i]->immune = 0;
159                 map.boss[i]->setThinkTime(2);
160                 map.boss[i]->think = &blackDroidAttack;
161                 map.boss[i]->react = NULL;
162                 map.boss[i]->die = &blackDroidDie;
163                 map.boss[i]->setActionFinished(120);
164                 Math::addBit(&map.boss[i]->flags, ENT_FLIES);
165                 Math::addBit(&map.boss[i]->flags, ENT_AIMS);
166                 Math::removeBit(&map.boss[i]->flags, ENT_FIRETRAIL);
167         }
168 }
169
170 // ************************ First part of final battle **********************************
171
172 void galdovFinalKeepAlive1()
173 {
174         map.boss[0]->health = 30 * game.skill;
175 }
176
177 void galdovFinalPainThrow()
178 {
179         self->dx = -3;
180         self->dy = -12;
181         
182         self->think = &galdovFinalFlee1;
183         self->setThinkTime(2);
184         self->setActionFinished(140);
185 }
186
187 void galdovFinalDropCrystal()
188 {
189         self->setThinkTime(2);
190         self->setActionFinished(2);
191         
192         int x = (int)player.x >> BRICKSHIFT;
193         int y = (int)player.y >> BRICKSHIFT;
194         x += Math::rrand(-2, 2);
195         y += Math::rrand(-2, 2);
196         
197         Math::limitInt(&x, 2, 62);
198         Math::limitInt(&y, 2, 26);
199         
200         if (map.data[x][y] == MAP_AIR)
201         {
202                 x = x << BRICKSHIFT;
203                 y = y << BRICKSHIFT;
204                 self->x = x;
205                 self->y = y;
206                 addTeleportParticles(self->x + 10, self->y + 10, 50, SND_TELEPORT2);
207                 addItem(101, "Reality Crystal", (int)self->x, (int)self->y, "RealityCrystal", 100, 1, 0, true);
208                 self->think = &galdovFinalPainThrow;
209                 self->react = &galdovFinalKeepAlive1;
210                 Math::removeBit(&self->flags, ENT_FLIES);
211                 Math::removeBit(&self->flags, ENT_FIRETRAIL);
212                 map.setMainBossPart(NULL);
213                 map.boss[0]->health = 30 * game.skill;
214                 map.boss[0]->setSprites(graphics.getSprite("GaldovPain", true), graphics.getSprite("GaldovPain", true), graphics.getSprite("GaldovPain", true));
215                 engine.setInfoMessage("Galdov has dropped the crystal! Quick! Get it!!", 99, INFO_HINT);
216                 audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE);
217         }
218 }
219
220 void galdovFinalDie()
221 {
222         if (game.missionOverReason == MIS_INPROGRESS)
223         {
224                 game.missionOverReason = MIS_GAMECOMPLETE;
225                 audio.stopMusic();
226                 audio.playSound(SND_BOSSCUSTOM3, CH_AMBIANCE);
227                 player.health = 10;
228                 self->dx = 5;
229                 self->dy = -6;
230                 self->react = NULL;
231                 Math::removeBit(&self->flags, ENT_FLIES);
232                 Math::removeBit(&self->flags, ENT_FIRETRAIL);
233         }
234         
235         self->setActionFinished(1);
236         self->setThinkTime(1);
237         
238         self->health--;
239         
240         if (self->health > -35)
241                 return;
242         
243         if (self->health == -99)
244         {
245                 checkObjectives(self->name, false);
246         }
247         
248         Math::wrapInt(&self->health, -99, -41);
249         
250         if ((self->health % 3) == 0)
251         {
252                 self->setActionFinished(5);
253                 self->setThinkTime(2);
254                 
255                 self->dx = Math::rrand(-5, 5);
256                 self->dy = Math::rrand(-5, 5);
257                 
258                 addExplosion(self->x, self->y, 50, &player);
259                 addSmokeAndFire(self, Math::rrand(-5, 5), Math::rrand(-5, 5), 2);
260         }
261 }
262
263 void galdovMiniFire()
264 {       
265         (self->x < player.x) ? self->face = 0 : self->face = 1;
266         
267         if (!hasClearShot(self))
268                 return;
269         
270         self->setActionFinished(9);
271         self->setThinkTime(2);
272         self->think = &galdovMiniFire;
273         
274         addBullet((Entity*)self, 0, 0);
275         
276         self->custom--;
277         if (self->custom == 0)
278         {
279                 self->think = &galdovMiniAttack;
280         }
281 }
282
283 void galdovFinalTeleport()
284 {
285         self->setThinkTime(2);
286         self->setActionFinished(2);
287         
288         int x = (int)player.x >> BRICKSHIFT;
289         int y = (int)player.y >> BRICKSHIFT;
290         x += Math::rrand(-10, 10);
291         y += Math::rrand(-10, 10);
292         
293         Math::limitInt(&x, 2, 62);
294         Math::limitInt(&y, 2, 26);
295         
296         if (self == map.boss[0])
297         {
298                 if (self->health < 45 * game.skill)
299                 {
300                         Math::limitInt(&x, 23, 62);
301                         Math::limitInt(&y, 42, 61);
302                         self->currentWeapon = getRandomGaldovWeapon();
303                 }
304         }
305         
306         if (map.data[x][y] == MAP_AIR)
307         {
308                 x = x << BRICKSHIFT;
309                 y = y << BRICKSHIFT;
310                 self->x = x;
311                 self->y = y;
312                 addTeleportParticles(self->x + 10, self->y + 10, 50, SND_TELEPORT2);
313                 self->think = &galdovMiniAttack;
314         }
315 }
316
317 void galdovMiniChasePlayer()
318 {
319         (self->x < player.x) ? self->face = 0 : self->face = 1;
320         
321         float dx, dy;
322         
323         Math::calculateSlope(player.x, player.y, self->x, self->y, &dx, &dy);
324         
325         self->dx = (dx * 2);
326         self->dy = (dy * 2);
327         
328         self->setThinkTime(10);
329         self->setActionFinished(10);
330         self->think = &galdovMiniAttack;
331 }
332
333 void galdovMiniMoveRandom()
334 {
335         self->think = &galdovMiniAttack;
336         
337         if (self->flags & ENT_FLIES)
338         {
339                 self->dx = Math::rrand(-200, 200);
340                 self->dy = Math::rrand(-200, 200);
341         
342                 self->dx *= 0.01;
343                 self->dy *= 0.01;
344         
345                 self->setThinkTime(2);
346                 self->setActionFinished(Math::rrand(60, 90));
347         }
348         else
349         {
350                 self->dy = Math::rrand(-12, 0);
351         
352                 (player.x < self->x) ? self->dx = -3 : self->dx = 3;
353                 
354                 self->think = &galdovMiniAttack;
355                 self->setActionFinished(45);
356         }
357 }
358
359 void galdovMiniAttack()
360 {
361         if (player.health < 1)
362         {
363                 self->dx = self->dy = 0;
364                 return;
365         }
366         
367         (self->x < player.x) ? self->face = 0 : self->face = 1;
368         
369         self->think = &galdovMiniAttack;
370         self->setThinkTime(2);
371         self->setActionFinished(2);
372         
373         int r = Math::prand() % 100;
374         
375         if (r < 10)
376         {
377                 self->think = &galdovMiniFire;
378                 self->custom = Math::rrand(1, 8);
379         }
380         else if (r < 15)
381         {
382                 addTeleportParticles(self->x + 10, self->y + 10, 50, SND_TELEPORT2);
383                 self->x = -9999;
384                 self->y = -9999;
385                 self->setActionFinished(120);
386                 self->setThinkTime(2);
387                 self->think = &galdovFinalTeleport;
388         }
389         else if (r < 80)
390         {
391                 self->think = &galdovMiniChasePlayer;
392         }
393         else if (r < 90)
394         {
395                 self->think = &galdovMiniMoveRandom;
396         }
397         else
398         {
399                 if ((self->flags & ENT_FLIES) && (Math::prand() % 5) == 0)
400                 {
401                         Math::removeBit(&self->flags, ENT_FLIES);
402                         Math::removeBit(&self->flags, ENT_FIRETRAIL);
403                 }
404                 else
405                 {
406                         Math::addBit(&self->flags, ENT_FLIES);
407                         Math::addBit(&self->flags, ENT_FIRETRAIL);
408                 }
409         }
410 }
411
412 void galdovMiniDie()
413 {
414         addExplosion(self->x, self->y, 5, self);
415         dropItems((int)self->x, (int)self->y);
416         self->setThinkTime(2);
417         self->setActionFinished(2);
418         self->active = false;
419         self->place(9999, 9999);
420         
421         // Don't kill it properly(!!)
422         self->health = -1;
423         
424         bool allDead = true;
425         
426         for (int i = 1 ; i < 10 ; i++)
427         {
428                 if (map.boss[i]->health > 0)
429                 {
430                         allDead = false;
431                 }
432         }
433         
434         if (allDead)
435         {
436                 map.boss[0]->think = &galdovFinalDropCrystal;
437                 map.boss[0]->setThinkTime(2);
438                 map.boss[0]->setActionFinished(2);
439         }
440 }
441
442 void galdovRejoin()
443 {
444         debug(("galdovRejoin\n"));
445         
446         for (int i = 1 ; i < 10 ; i++)
447         {
448                 if (map.boss[i] != NULL)
449                 {
450                         addTeleportParticles(map.boss[i]->x + 4, map.boss[i]->y + 4, 75, -1);
451                         
452                         if ((Math::prand() % (2 + (game.skill))) == 0)
453                         {
454                                 dropItems((int)map.boss[i]->x, (int)map.boss[i]->y);
455                         }
456                         
457                         map.boss[i]->place(9999, 9999);
458                         map.boss[i]->active = false;
459                 }
460         }
461         
462         self->setThinkTime(2);
463         self->setActionFinished(120);
464         self->think = &galdovFinalTeleport;
465         self->currentWeapon = getRandomGaldovWeapon();
466         
467         audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE);
468         
469         map.setMainBossPart(map.boss[0]);
470         
471         debug(("galdovRejoin: Done\n"));
472 }
473
474 void galdovFinalMiniReact()
475 {
476         if (self->health > 0)
477         {
478                 map.setMainBossPart(self);
479         }
480         else
481         {
482                 map.setMainBossPart(NULL);
483         }
484 }
485
486 void galdovFinalSplit()
487 {
488         debug(("galdovFinalSplit\n"));
489         
490         for (int i = 1 ; i < 10 ; i++)
491         {
492                 if (map.boss[i] == NULL)
493                 {
494                         map.boss[i] = new Boss();
495                         strcpy(map.boss[i]->name, "MiniGaldov");
496                         map.boss[i]->health = 10 * game.skill;
497                         map.boss[i]->maxHealth = 10 * game.skill;
498                 }
499                 map.boss[i]->setSprites(graphics.getSprite("GaldovMiniRight", true), graphics.getSprite("GaldovMiniLeft", true), graphics.getSprite("GaldovMiniLeft", true));
500                 map.boss[i]->currentWeapon = getRandomAimedWeapon();
501                 map.boss[i]->face = 0;
502                 map.boss[i]->active = true;
503                 
504                 if (map.boss[i]->health > 0)
505                 {
506                         map.boss[i]->dx = Math::rrand(-2, 2);
507                         map.boss[i]->dy = Math::rrand(-2, 2);
508                         map.boss[i]->x = map.boss[0]->x;
509                         map.boss[i]->y = map.boss[0]->y;
510                 }
511                 else
512                 {
513                         map.boss[i]->active = false;
514                 }
515                 
516                 map.boss[i]->immune = 0;
517                 map.boss[i]->setThinkTime(2);
518                 map.boss[i]->setActionFinished(120);
519                 map.boss[i]->think = &galdovMiniAttack;
520                 map.boss[i]->react = &galdovFinalMiniReact;
521                 map.boss[i]->die = &galdovMiniDie;
522                 Math::addBit(&map.boss[i]->flags, ENT_AIMS);
523                 Math::addBit(&map.boss[i]->flags, ENT_FLIES);
524                 Math::addBit(&map.boss[i]->flags, ENT_FIRETRAIL);
525                 
526                 addTeleportParticles(map.boss[i]->x + 10 + map.boss[i]->dx, map.boss[i]->y + 10 + map.boss[i]->dy, 75, -1);
527         }
528         
529         map.boss[0]->place(9999, 9999);
530         map.boss[0]->setThinkTime(2);
531         map.boss[0]->setActionFinished(Math::rrand(10, 15) * 60);
532         map.boss[0]->think = &galdovRejoin;
533         map.boss[0]->active = true;
534         
535         audio.playSound(SND_BOSSCUSTOM1, CH_AMBIANCE);
536         map.setMainBossPart(NULL);
537         
538         debug(("galdovFinalSplit: Done\n"));
539 }
540
541 void galdovFinalReact()
542 {
543         map.boss[0]->health = 45 * game.skill;
544         
545         if ((Math::prand() % 5) == 0)
546         {
547                 map.boss[0]->setThinkTime(2);
548                 map.boss[0]->setActionFinished(2);
549                 map.boss[0]->think = &galdovFinalSplit;
550         }
551 }
552
553 void galdovFinalInit()
554 {
555         debug(("galdovFinalInit\n"));
556         
557         map.boss[0] = new Boss();
558         strcpy(map.boss[0]->name, "Galdov");
559         map.boss[0]->health = 45 * game.skill;
560         map.boss[0]->maxHealth = 45 * game.skill;
561         map.boss[0]->setSprites(graphics.getSprite("GaldovRight", true), graphics.getSprite("GaldovLeft", true), graphics.getSprite("GaldovDie", true));
562         map.boss[0]->currentWeapon = &weapon[WP_AIMEDPISTOL];
563         map.boss[0]->face = 0;
564         map.boss[0]->active = true;
565         map.boss[0]->x = 480;
566         map.boss[0]->y = 576;
567         map.boss[0]->immune = 0;
568         map.boss[0]->setThinkTime(2);
569         map.boss[0]->setActionFinished(2);
570         map.boss[0]->think = &galdovMiniAttack;
571         //map.boss[0]->think = &galdovFinalDropCrystal;
572         map.boss[0]->react = &galdovFinalReact;
573         map.boss[0]->die = &galdovFinalDie;
574         Math::addBit(&map.boss[0]->flags, ENT_AIMS);
575         
576         audio.loadSound(SND_BOSSCUSTOM1, "sound/galdovSplit.wav");
577         audio.loadSound(SND_BOSSCUSTOM2, "sound/galdovPain.wav");
578         audio.loadSound(SND_BOSSCUSTOM3, "sound/galdovDie.wav");
579         
580         map.setMainBossPart(map.boss[0]);
581         
582         debug(("galdovFinalInit: Done\n"));
583 }
584
585 // ******************** Second part of Final Battle *********************************
586
587 void galdovFinalReact2()
588 {
589         if (self->health < 1)
590                 return;
591         
592         if ((Math::prand() % 12) == 0)
593         {
594                 addTeleportParticles(self->x + (self->width / 2), self->y + (self->height / 2), 50, SND_TELEPORT3);
595                 map.boss[0]->setThinkTime(2);
596                 map.boss[0]->setActionFinished(2);
597                 map.boss[0]->think = &galdovFinalTeleport;
598         }
599 }
600
601 void galdovFinalStandUp()
602 {
603         map.boss[0]->setSprites(graphics.getSprite("GaldovShieldRight", true), graphics.getSprite("GaldovShieldLeft", true), graphics.getSprite("GaldovShieldLeft", true));
604         self->setThinkTime(2);
605         self->setActionFinished(2);
606         addTeleportParticles(self->x + (self->width / 2), self->y + (self->height / 2), 50, SND_TELEPORT3);
607         self->think = &galdovFinalTeleport;
608         
609         if (map.boss[0]->health <= 15 * game.skill)
610         {
611                 self->setSprites(graphics.getSprite("GaldovRight", true), graphics.getSprite("GaldovLeft", true), graphics.getSprite("GaldovDie", true));
612                 Math::removeBit(&map.boss[0]->flags, ENT_IMMUNE);
613                 map.boss[0]->react = &galdovFinalReact2;
614         }
615 }
616
617 void galdovFinalPainThrow2()
618 {
619         self->dx = -3;
620         self->dy = -12;
621         
622         self->think = &galdovFinalStandUp;
623         self->setThinkTime(2);
624         self->setActionFinished(90);
625 }
626
627 void orbSeekGaldov()
628 {
629         (self->x < player.x) ? self->face = 0 : self->face = 1;
630         
631         float dx, dy;
632         
633         Math::calculateSlope(map.boss[0]->x, map.boss[0]->y, self->x, self->y, &dx, &dy);
634         
635         self->dx = (dx * (1 + game.skill));
636         self->dy = (dy * (1 + game.skill));
637         
638         self->setThinkTime(2);
639         self->setActionFinished(5);
640         self->think = &orbSeekGaldov;
641         
642         int distX = (int)fabs(map.boss[0]->x - self->x);
643         int distY = (int)fabs(map.boss[0]->y - self->y);
644
645         distX *= distX;
646         distY *= distY;
647
648         int distance = (int)sqrt(distX + distY);
649         
650         if (distance <= 10)
651         {
652                 self->active = false;
653                 self->setActionFinished(60);
654                 self->setThinkTime(60);
655                 addExplosion(self->x, self->y, 75, &player);
656                 self->place(9999, 9999);
657                 map.boss[0]->setSprites(graphics.getSprite("GaldovPain", true), graphics.getSprite("GaldovPain", true), graphics.getSprite("GaldovPain", true));
658                 map.boss[0]->think = &galdovFinalPainThrow2;
659                 map.boss[0]->health -= (3 * game.skill);
660                 Math::removeBit(&map.boss[0]->flags, ENT_FLIES);
661                 Math::removeBit(&map.boss[0]->flags, ENT_FIRETRAIL);
662                 audio.playSound(SND_BOSSCUSTOM2, CH_AMBIANCE);
663         }
664 }
665
666 void galdovFinalShieldInit()
667 {
668         self->setActionFinished(60);
669         self->setThinkTime(60);
670         self->think = &galdovMiniAttack;
671         self->react = NULL;
672         
673         Math::addBit(&map.boss[0]->flags, ENT_IMMUNE);
674         
675         for (int i = 1 ; i < 6 ; i++)
676         {
677                 if (map.boss[i] != NULL)
678                 {
679                         delete map.boss[i];
680                 }
681                 map.boss[i] = new Boss();
682                 strcpy(map.boss[i]->name, "OrbBomb");
683                 map.boss[i]->setSprites(graphics.getSprite("DroidOrb", true), graphics.getSprite("DroidOrb", true), graphics.getSprite("DroidOrb", true));
684                 map.boss[i]->health = 999999;
685                 map.boss[i]->maxHealth = 99999;
686                 map.boss[i]->immune = 0;
687                 Math::addBit(&map.boss[0]->flags, ENT_IMMUNE);
688                 map.boss[i]->active = false;
689                 map.boss[i]->setActionFinished(2);
690                 map.boss[i]->setThinkTime(2);
691                 map.boss[i]->think = &orbSeekGaldov;
692                 map.boss[i]->react = NULL;
693                 Math::addBit(&map.boss[i]->flags, ENT_FLIES);
694         }
695         
696         map.boss[1]->place(864, 1536);
697         map.boss[2]->place(864, 1792);
698         map.boss[3]->place(1856, 1792);
699         map.boss[4]->place(1888, 1440);
700         map.boss[5]->place(1408, 1472);
701         
702         galdovInitBlackDroids();
703 }
704
705 void galdovFinalWaitForObjective()
706 {
707         self->setActionFinished(120);
708         self->setThinkTime(2);
709         
710         Objective *objective = (Objective*)map.objectiveList.getHead();
711
712         while (objective->next != NULL)
713         {
714                 objective = (Objective*)objective->next;
715
716                 if (strstr(objective->target, "Reality"))
717                 {
718                         if (objective->completed)
719                         {
720                                 player.dx = 1000;
721                                 player.dy = 1408;
722                                 Math::addBit(&player.flags, ENT_TELEPORTING);
723                                 self->think = &galdovFinalShieldInit;
724                                 map.boss[0]->setSprites(graphics.getSprite("GaldovShieldRight", true), graphics.getSprite("GaldovShieldLeft", true), graphics.getSprite("GaldovShieldLeft", true));
725                                 self->setActionFinished(2);
726                                 self->setThinkTime(2);
727                                 map.setMainBossPart(map.boss[0]);
728                         }
729                 }
730         }
731 }
732
733 void galdovFinalFlee1()
734 {
735         self->dx = 800;
736         self->dy = 1408;
737         addTeleportParticles(self->x + (self->width / 2), self->y + (self->height / 2), 50, SND_TELEPORT3);
738         Math::addBit(&self->flags, ENT_TELEPORTING);
739         Math::addBit(&self->flags, ENT_FLIES);
740         Math::addBit(&self->flags, ENT_FIRETRAIL);
741         self->think = &galdovFinalWaitForObjective;
742         self->setActionFinished(2);
743         self->setThinkTime(2);
744 }