static void die() { Entity *e; if ((prand() % 3 == 0) && isSpaceEmpty(self) == NULL) { /* Drop a shell */ setEntityAnimation(self, "WALK"); if (strcmpignorecase(self->name, "enemy/purple_snail") == 0) { e = addSnailShell(self->x, self->y, "enemy/purple_snail_shell"); } else { e = addSnailShell(self->x, self->y, "enemy/snail_shell"); } e->face = self->face; e->x += (self->w - e->w) / 2; } playSoundToMap("sound/enemy/snail/snail_die", -1, self->x, self->y, 0); entityDie(); }
static void die() { Entity *e, *arrow; e = getFreeEntity(); if (e == NULL) { showErrorAndExit("No free slots to add an Energy Drainer Ball"); } loadProperties("enemy/energy_drainer_ball", e); e->x = self->x + self->w / 2; e->y = self->y + self->h / 2; e->targetX = self->targetX; e->targetY = self->targetY; e->target = self->target; e->x -= e->w / 2; e->y -= e->h / 2; e->startY = e->y; e->action = &ballWait; e->draw = &drawLoopingAnimationToMap; e->die = NULL; e->touch = NULL; e->fallout = NULL; e->type = ENEMY; setEntityAnimation(e, "STAND"); e->thinkTime = 180; self->mental = 0; /* Drop between 1 and 3 arrows */ arrow = addTemporaryItem("weapon/normal_arrow", self->x, self->y, RIGHT, 0, ITEM_JUMP_HEIGHT); arrow->health = 1 + (prand() % 3); entityDie(); }
static void die() { Entity *e; if (prand() % 3 == 0) { e = addKeyItem("item/spike_ball", self->x + self->w / 2, self->y); e->x -= e->w / 2; e->action = &generalItemAction; e->flags |= DO_NOT_PERSIST; } playSoundToMap("sound/enemy/armadillo/armadillo_die", -1, self->x, self->y, 0); entityDie(); }
static void die() { Entity *e; e = getFreeEntity(); if (e == NULL) { showErrorAndExit("No free slots to add an Energy Drainer Ball"); } loadProperties("enemy/energy_drainer_ball", e); setEntityAnimation(e, "STAND"); e->target = self->head; e->x = self->x + self->w / 2; e->y = self->y + self->h / 2; e->targetX = e->target->x + e->target->w / 2 - e->w / 2; e->targetY = e->target->y + e->target->h / 2 - e->h / 2; e->x -= e->w / 2; e->y -= e->h / 2; e->startY = e->y; e->action = &ballWait; e->draw = &drawLoopingAnimationToMap; e->type = ENEMY; e->thinkTime = 90; playSoundToMap("sound/enemy/gazer/gazer_die", -1, self->x, self->y, 0); entityDie(); }
static void blueDie() { self->thinkTime--; if (self->thinkTime <= 0) { if (self->maxThinkTime == 4) { increaseKillCount(); entityDie(); } else { calculatePath(self->x, self->y, self->targetX, self->targetY, &self->dirX, &self->dirY); self->flags |= (NO_DRAW|HELPLESS|TELEPORTING); playSoundToMap("sound/common/teleport", BOSS_CHANNEL, self->x, self->y, 0); self->touch = &entityTouch; self->action = &blueWait; self->active = FALSE; self->startX = self->targetX; self->startY = self->targetY; self->health = self->maxHealth; } } else { shudder(); } }
static void die() { Entity *e; playSoundToMap("sound/enemy/tortoise/tortoise_die", -1, self->x, self->y, 0); if (getInventoryItemByObjectiveName("Tortoise Shell") == NULL) { e = dropCollectableItem("item/tortoise_shell", self->x + self->w / 2, self->y, self->face); e->x -= e->w / 2; } addMedal("kill_rampaging"); if (self->startX == -1) { fadeBossMusic(); } entityDie(); }
static void die() { playSoundToMap("sound/enemy/wasp/wasp_die", -1, self->x, self->y, 0); entityDie(); }
static void die() { playSoundToMap("sound/enemy/tortoise/tortoise_die", -1, self->x, self->y, 0); entityDie(); }
static void segmentMove() { int currentFrame, health; if (self->thinkTime <= 0 && self->target->mental >= 2) { currentFrame = self->currentFrame; health = self->health; loadProperties("enemy/green_centipede_segment", self); self->health = health; self->mental = self->target->mental; self->touch = &greenTouch; self->thinkTime = 60 * 30; self->currentFrame = currentFrame; } if (self->mental >= 2) { self->thinkTime--; if (self->thinkTime <= 300) { if (self->thinkTime % 15 == 0) { currentFrame = self->currentFrame; if (self->mental < 4) { setEntityAnimation(self, self->mental == 2 ? "CUSTOM_1" : "CUSTOM_2"); self->mental = self->mental == 2 ? 4 : 5; } else { setEntityAnimation(self, "STAND"); self->mental = self->mental == 4 ? 2 : 3; } self->currentFrame = currentFrame; } if (self->thinkTime <= 0) { currentFrame = self->currentFrame; health = self->health; loadProperties(self->mental % 2 == 0 ? "enemy/yellow_centipede_segment" : "enemy/red_centipede_segment", self); self->health = health; self->mental = self->mental % 2; self->touch = &entityTouch; self->currentFrame = currentFrame; } } } else if (self->mental == 0 && self->head->health <= 0) { self->health = 0; entityDie(); } if (self->target->health <= 0) { if (self->mental == 1) { self->action = &becomeHead; } else { self->health = 0; entityDieNoDrop(); } } /* If segment is facing the same way as the target then just move with it */ if (self->face == LEFT && self->x + self->w <= self->target->x) { self->x = self->target->x - self->w; self->face = self->target->face; } else if (self->face == RIGHT && self->x >= self->target->x + self->target->w) { self->x = self->target->x + self->target->w; self->face = self->target->face; } else { self->dirX = self->face == LEFT ? -self->target->speed : self->target->speed; } checkToMap(self); }
static void die() { playSoundToMap("sound/enemy/centipede/centipede_die", -1, self->x, self->y, 0); entityDie(); }
static void die() { playSoundToMap("sound/enemy/jumping_slime/slime_die", -1, self->x, self->y, 0); entityDie(); }