Ejemplo n.º 1
0
void
dodigger(struct digger_draw_api *ddap)
{
  int n;
  int16_t tdir;

  newframe();
  if (gauntlet) {
    drawlives(ddap);
    if (cgtime<ftime)
      timeout=true;
    cgtime-=ftime;
  }
  for (n=curplayer;n<diggers+curplayer;n++) {
    if (digdat[n].bob.expsn!=0)
      drawexplosion(n);
    else
      updatefire(ddap, n);
    if (digvisible) {
      if (digdat[n].dob.alive)
        if (digdat[n].bagtime!=0) {
          tdir = digdat[n].dob.dir;
          digdat[n].dob.dir = digdat[n].mdir;
          drawdig(n);
          digdat[n].dob.dir = tdir;
          incpenalty();
          digdat[n].bagtime--;
        }
        else
          updatedigger(ddap, n);
      else
        diggerdie(ddap, n);
    }
    if (digdat[n].emocttime>0)
      digdat[n].emocttime--;
  }
  if (bonusmode && isalive()) {
    if (bonustimeleft!=0) {
      bonustimeleft--;
      if (startbonustimeleft!=0 || bonustimeleft<20) {
        startbonustimeleft--;
        if (bonustimeleft&1) {
          ddap->ginten(0);
          soundbonus();
        }
        else {
          ddap->ginten(1);
          soundbonus();
        }
        if (startbonustimeleft==0) {
          music(0);
          soundbonusoff();
          ddap->ginten(1);
        }
      }
    }
    else {
      endbonusmode(ddap);
      soundbonusoff();
      music(1);
    }
  }
  if (bonusmode && !isalive()) {
    endbonusmode(ddap);
    soundbonusoff();
    music(1);
  }
}
Ejemplo n.º 2
0
void dodigger(void)
{
  int n;
  newframe();
  if (gauntlet) {
    drawlives();
    if (cgtime<ftime)
      timeout=TRUE;
    cgtime-=ftime;
  }
  for (n=curplayer;n<diggers+curplayer;n++) {
    if (digdat[n].expsn!=0)
      drawexplosion(n);
    else
      updatefire(n);
    if (digvisible)
      if (digdat[n].alive)
        if (digdat[n].bagtime!=0) {
          drawdig(n,digdat[n].mdir,digdat[n].x,digdat[n].y,
                  digdat[n].notfiring && digdat[n].rechargetime==0);
          incpenalty();
          digdat[n].bagtime--;
        }
        else
          updatedigger(n);
      else
        diggerdie(n);
    if (digdat[n].emocttime>0)
      digdat[n].emocttime--;
  }
  if (bonusmode && isalive()) {
    if (bonustimeleft!=0) {
      bonustimeleft--;
      if (startbonustimeleft!=0 || bonustimeleft<20) {
        startbonustimeleft--;
        if (bonustimeleft&1) {
          ginten(0);
          soundbonus();
        }
        else {
          ginten(1);
          soundbonus();
        }
        if (startbonustimeleft==0) {
          music(0);
          soundbonusoff();
          ginten(1);
        }
      }
    }
    else {
      endbonusmode();
      soundbonusoff();
      music(1);
    }
  }
  if (bonusmode && !isalive()) {
    endbonusmode();
    soundbonusoff();
    music(1);
  }
}