static int drawChain() { int y; self->y = self->head->y - self->h; y = self->head->mental - self->h * 2; drawLoopingAnimationToMap(); while (self->y >= y) { self->x = self->head->x; drawSpriteToMap(); self->x = self->head->x + self->head->w - self->w; drawSpriteToMap(); self->y -= self->h; } return TRUE; }
static int ringDraw() { int i, endX, endY; float diffX, diffY; endX = self->head->x; endY = self->head->y + self->head->h / 2 - self->h / 2; diffX = (endX - self->head->startX) / self->head->mental; diffY = (endY - self->head->startY) / self->head->mental; drawLoopingAnimationToMap(); for (i=0;i<self->head->mental;i++) { drawSpriteToMap(); self->x += diffX; self->y += diffY; } self->x = self->startX; self->y = self->startY; return 1; }
static int draw() { drawLoopingAnimationToMap(); self->x += self->offsetX; self->y -= self->offsetY; setEntityAnimation(self, "WALK"); self->face = LEFT; while (self->x < self->endX) { drawSpriteToMap(); self->x += self->offsetX; self->y -= self->offsetY; } self->face = RIGHT; setEntityAnimation(self, "STAND"); self->x = self->startX; self->y = self->startY; return TRUE; }
static int draw() { int startX; startX = self->x; /* Draw the segments first */ setEntityAnimation(self, "BLOCK"); if (self->face == RIGHT) { while (self->x >= self->startX) { drawSpriteToMap(); self->x -= self->w; } } else { while (self->x <= self->startX) { drawSpriteToMap(); self->x += self->w; } } /* Draw the tip */ setEntityAnimation(self, self->health == 1 ? "WALK" : "JUMP"); self->x = startX; drawLoopingAnimationToMap(); return TRUE; }
static int drawBeam() { self->y = self->startY; drawLoopingAnimationToMap(); while (self->y > 0) { self->y -= self->h; drawSpriteToMap(); } return TRUE; }
static int drawVine() { int y = self->head->startY - self->h; drawLoopingAnimationToMap(); while (self->y > y) { drawSpriteToMap(); self->y -= self->h; } return TRUE; }
static int drawChain() { self->x = self->startX; self->y = self->startY; drawLoopingAnimationToMap(); while (self->x > self->endX && self->y > self->endY) { drawSpriteToMap(); self->x -= self->offsetX; self->y -= self->offsetY; } return TRUE; }
static int drawChain() { int y; y = self->head->startY - self->h * 2; drawLoopingAnimationToMap(); while (self->y >= y) { drawSpriteToMap(); self->y -= self->h; } return TRUE; }
static int drawChain() { int i; float partDistanceX, partDistanceY; partDistanceX = self->head->x + self->head->w / 2 - self->w / 2 - self->x; partDistanceY = self->head->y - self->y; partDistanceX /= 8; partDistanceY /= 8; for (i=0;i<8;i++) { drawSpriteToMap(); self->x += partDistanceX; self->y += partDistanceY; } return TRUE; }
static int drawTongue() { float y; y = self->y; setEntityAnimation(self, "WALK"); while (self->y >= self->startY) { drawSpriteToMap(); self->y -= self->h; } setEntityAnimation(self, "STAND"); self->y = y; drawLoopingAnimationToMap(); return TRUE; }
static int draw() { int y = self->y; drawLoopingAnimationToMap(); setEntityAnimation(self, "BODY"); self->y = y - self->h; while (self->y >= self->startY - self->h) { drawSpriteToMap(); self->y -= self->h; } setEntityAnimation(self, "HEAD"); self->y = y; return TRUE; }
static int iceDraw() { int frame, alpha; float timer; /* Draw the boss with its lowering alpha */ drawLoopingAnimationToMap(); frame = self->currentFrame; timer = self->frameTimer; alpha = self->alpha; /* Draw the other part with its rising alpha */ setEntityAnimation(self, "ICE_STAND"); self->currentFrame = frame; self->frameTimer = timer; self->alpha = 255 - alpha; drawSpriteToMap(); /* Reset back to original */ setEntityAnimation(self, "NORMAL_STAND"); self->currentFrame = frame; self->frameTimer = timer; self->alpha = alpha; return 1; }
static int beamDraw() { int drawn; Entity *e; if (self->head->mental == 1 && self->head->health > 0) { self->x = self->head->x; self->y = self->head->endX; drawn = drawLoopingAnimationToMap(); if (drawn == TRUE) { e = addPixelDecoration(self->x + self->w / 2, self->y); if (e != NULL) { e->dirX = prand() % 20; e->dirY = prand() % 20; if (prand() % 2 == 0) { e->dirX *= -1; } e->dirX /= 10; e->dirY /= 10; e->thinkTime = 20 + (prand() % 30); e->health = 255; e->maxHealth = 0; e->mental = 255; } } while (self->y < self->head->endY - self->h) { self->y += self->h; drawn = drawSpriteToMap(); } if (drawn == TRUE) { e = addPixelDecoration(self->x + self->w / 2, self->head->endY); if (e != NULL) { e->dirX = prand() % 20; e->dirY = -prand() % 20; if (prand() % 2 == 0) { e->dirX *= -1; } e->dirX /= 10; e->dirY /= 10; e->thinkTime = 20 + (prand() % 30); e->health = 255; e->maxHealth = 0; e->mental = 255; } } } return TRUE; }