static void blindAttack() { Entity *e; self->thinkTime--; if (self->thinkTime <= 0) { fadeFromColour(0, 0, 0, 30); e = getFreeEntity(); if (e == NULL) { showErrorAndExit("No free slots to add Chaos blind spell"); } loadProperties("boss/sorceror_disintegration_spell", e); e->action = &blindSpellWait; e->draw = &drawLoopingAnimationToMap; e->flags |= NO_DRAW|FLY; e->x = self->x; e->y = self->y; e->thinkTime = 600; e->mental = 2; e->head = self; setDarkMap(TRUE); self->action = &attackFinished; self->target = e; } self->maxThinkTime--; checkToMap(self); }
static void drawRain() { int i; if (game.weatherThinkTime <= 0) { i = playSoundToMap("sound/enemy/thunder_cloud/lightning", -1, player.x, player.y, 0); fadeFromColour(255, 255, 255, 30); game.weatherThinkTime = 600 + i * 60; } for (i=0;i<MAX_DROPS;i++) { if (droplet[i].active == TRUE) { drawBox(game.screen, droplet[i].x, droplet[i].y, 1, 8, 220, 220, 220); } } }
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; } }