static void breatheFireFinish() { if (self->mental == 0) { setEntityAnimation(self, "MOUTH_OPEN"); self->thinkTime--; if (self->thinkTime <= 0) { setEntityAnimation(self, "STAND"); if (player.health <= 0) { player.mental = 0; createAutoDialogBox(_("Chaos"), _("Pathetic"), 300); } self->action = &attackFinished; self->creditsAction = &creditsDone; self->maxThinkTime = 30 * 60; } } checkToMap(self); }
static void vineAttackInit() { self->thinkTime = 120; createAutoDialogBox(_("Chaos"), _("Tendrils"), 90); self->action = &vineAttack; self->maxThinkTime--; checkToMap(self); }
static void riftAttackInit() { createAutoDialogBox(_("Chaos"), _("Rift"), 90); self->thinkTime = 60; self->action = &riftAttack; self->maxThinkTime--; checkToMap(self); }
static void blindAttackInit() { self->thinkTime = 120; createAutoDialogBox(_("Chaos"), _("Darkness"), 90); self->action = &blindAttack; self->maxThinkTime--; checkToMap(self); }
static void confuseAttackInit() { self->thinkTime = 120; createAutoDialogBox(_("Chaos"), _("Confuse"), 90); self->action = &confuseAttack; self->maxThinkTime--; checkToMap(self); }
static void spearAttackInit() { self->thinkTime = 60; createAutoDialogBox(_("Chaos"), _("Impale"), 90); self->action = &spearAttack; self->maxThinkTime--; checkToMap(self); }
static void stalagmiteAttackInit() { createAutoDialogBox(_("Chaos"), _("Stalagmite"), 90); self->mental = 1 + prand() % 3; self->action = &stalagmiteAttack; self->thinkTime = 60; self->maxThinkTime--; checkToMap(self); }
static void holdPersonInit() { createAutoDialogBox(_("Chaos"), _("Hold Person"), 90); self->thinkTime = 15; self->action = &holdPerson; self->mental = 3; self->maxThinkTime--; checkToMap(self); }
static void spinnerAttackInit() { createAutoDialogBox(_("Chaos"), _("Orbs"), 90); self->mental = 3 + prand() % 4; self->action = &spinnerAttack; self->thinkTime = 60; self->maxThinkTime--; checkToMap(self); }
static void dieMoveToTop() { EntityList *l, *list; Entity *e; self->thinkTime--; if (self->thinkTime <= 0) { switch (self->mental) { case 0: self->target->inUse = FALSE; stopSound(self->target->endX); setEntityAnimation(self, "INTRO"); self->flags &= ~NO_DRAW; addParticleExplosion(self->x + self->w / 2, self->y + self->h / 2); playSoundToMap("sound/common/spell", -1, self->x, self->y, 0); self->thinkTime = 90; self->mental = 1; break; case 1: createAutoDialogBox(_("Azriel"), _("Until we meet again..."), 120); self->mental = 2; self->thinkTime = 180; break; default: list = createPixelsFromSprite(getCurrentSprite(self)); for (l=list->next;l!=NULL;l=l->next) { e = l->entity; e->dirX = prand() % 30 * (e->x < self->x + self->w / 2 ? -1 : 1); e->dirY = prand() % 30 * (e->y < self->y + self->h / 2 ? -1 : 1); e->dirX /= 10; e->dirY /= 10; e->thinkTime = 180 + prand() % 180; } self->flags |= NO_DRAW; freeEntityList(list); self->thinkTime = 120; self->action = &dieWait; playSoundToMap("sound/boss/azriel/azriel_die", BOSS_CHANNEL, self->x, self->y, 0); break; } } }
static void finalAttack() { Entity *temp; self->thinkTime--; if (self->thinkTime <= 0) { switch (self->mental) { case 0: setEntityAnimation(self, "ATTACK_4"); addParticleExplosion(self->x + self->w / 2, self->y + self->h / 2); playSoundToMap("sound/common/spell", -1, self->x, self->y, 0); self->flags &= ~NO_DRAW; self->face = RIGHT; createAutoDialogBox(_("Sorceror"), _("Enough! Prepare to die..."), 180); self->thinkTime = 180; self->mental = 1; temp = getFreeEntity(); if (temp == NULL) { showErrorAndExit("No free slots to add a the staff"); } loadProperties("boss/sorceror_staff", temp); temp->action = &staffMoveAroundSorceror; temp->draw = &drawLoopingAnimationToMap; temp->type = ENEMY; setEntityAnimationByID(temp, 0); temp->x = self->x + self->w / 2 - temp->w / 2; temp->y = self->y + self->h / 2 - temp->h / 2; temp->startX = temp->x; temp->startY = temp->y; temp->head = self; temp->health = self->health; temp->mental = self->box.w; break; case 1: temp = getFreeEntity(); if (temp == NULL) { showErrorAndExit("No free slots to add a the Final Attack spell"); } loadProperties("boss/sorceror_final_spell", temp); temp->action = &finalSpellWait; temp->draw = &drawLoopingAnimationToMap; temp->type = ENEMY; setEntityAnimationByID(temp, 0); temp->x = self->x + temp->offsetX; temp->y = self->y + temp->offsetY; temp->head = self; temp->thinkTime = 60; self->thinkTime = 660; self->mental = 2; temp->health = self->health; break; default: self->mental = 3; playSoundToMap("sound/common/massive_explosion", -1, self->x, self->y, 0); fadeFromColour(0, 0, 200, 30); /* Gib the player */ temp = self; self = &player; freeEntityList(playerGib()); self = temp; self->thinkTime = 120; self->action = &finalAttackFinish; break; } } else if (self->thinkTime <= 420 && self->mental == 2) { self->startX = 2; } }
static void breatheFire() { Entity *e; self->thinkTime--; if (self->thinkTime <= 0) { setEntityAnimation(self, "BREATHE_FIRE"); switch (prand() % 4) { case 0: createAutoDialogBox(_("Chaos"), _("Burn to ashes!"), 180); break; case 1: createAutoDialogBox(_("Chaos"), _("Feel my power!"), 180); break; case 2: createAutoDialogBox(_("Chaos"), _("I will destroy you!"), 180); break; default: createAutoDialogBox(_("Chaos"), _("Suffer!"), 180); break; } e = getFreeEntity(); if (e == NULL) { showErrorAndExit("No free slots to add Chaos's Fire"); } loadProperties("boss/chaos_flame", e); e->face = self->face; e->action = &flameWait; e->creditsAction = &flameWait; e->draw = &drawLoopingAnimationToMap; e->thinkTime = 300; if (game.status != IN_CREDITS) { shakeScreen(LIGHT, 300); } e->mental = 1; e->health = 1200; e->head = self; if (self->face == LEFT) { e->x = self->x + self->w - e->w - e->offsetX; } else { e->x = self->x + e->offsetX; } e->y = self->y + e->offsetY; e->dirX = 14; e->startX = e->x; e->endX = e->face == LEFT ? getMapStartX() - SCREEN_WIDTH : getMapStartX() + SCREEN_WIDTH; playSoundToMap("sound/boss/chaos/breathe_fire", BOSS_CHANNEL, self->x, self->y, 0); self->thinkTime = 30; self->mental = 1; self->action = &breatheFireFinish; self->creditsAction = &breatheFireFinish; } checkToMap(self); }