/** * Draw episode 1 guardian. * * @param ticks Time * @param change Time since last iteration */ void MedGuardian::draw(unsigned int ticks, int change) { Anim *stageAnim; unsigned char frame; if (next) next->draw(ticks, change); fixed xChange = getDrawX(change); fixed yChange = getDrawY(change); frame = ticks / (set->animSpeed << 5); if (stage == 0) stageAnim = anim; else stageAnim = level->getAnim(set->anims[E_LFINISHANIM | (animType & 1)] & 0x7F); stageAnim->setFrame(frame + gridX + gridY, true); if (ticks < flashTime) stageAnim->flashPalette(0); drawnX = x + anim->getXOffset(); drawnY = y + anim->getYOffset() + stageAnim->getOffset(); stageAnim->draw(xChange, yChange); if (ticks < flashTime) stageAnim->restorePalette(); return; }
/** * Draw episode B guardian. * * @param ticks Time * @param change Time since last iteration */ void DeckGuardian::draw (unsigned int ticks, int change) { Anim* anim; if (next) next->draw(ticks, change); // If the event has been removed from the grid, do not show it if (!set) return; // Draw the boss if (stage < 3) { // Draw unit anim = level->getAnim(29 + stage); if (stage == 0) { width = F8; drawnX = x - F64; } else if (stage == 1) { width = F8; drawnX = x + F32 - F8; } else if (stage == 2) { width = F64 + F32; drawnX = x - F64; } drawnY = y + F32; height = F32; if (ticks < flashTime) anim->flashPalette(0); if (stage == 0) anim->draw(getDrawX(change) - F64, getDrawY(change) + F32); else if (stage == 1) anim->draw(getDrawX(change) + F32 - F8 - F4, getDrawY(change) + F32); else anim->draw(getDrawX(change) + F8 - F64, getDrawY(change) + F32); if (ticks < flashTime) anim->restorePalette(); } return; }
/** * Draw the event's energy bar * * @param ticks Time */ void Event::drawEnergy (unsigned int ticks) { Anim* anim; int hits; if (!set || set->modifier != 8) { if (next) next->drawEnergy(ticks); return; } else if (set->strength) { // Draw boss energy bar hits = level->getEventHits(gridX, gridY) * 100 / set->strength; // Devan head anim = level->getMiscAnim(1); anim->setFrame(0, true); if (ticks < flashTime) anim->flashPalette(0); anim->draw(ITOF(viewW - 44), ITOF(hits + 48)); if (ticks < flashTime) anim->restorePalette(); // Bar drawRect(viewW - 40, hits + 40, 12, 100 - hits, (ticks < flashTime)? 0: 32); } return; }