Exemple #1
0
void m_altar(struct monster *m)
{
    int visible = view_los_p(Player.x, Player.y, m->x, m->y);

    if(m->uniqueness != COMMON) {
        strcpy(Str1, m->monstring);
    }
    else {
        strcpy(Str1, "The ");
        strcat(Str1, m->monstring);
    }

    strcat(Str1, " walks next to an altar...");

    if(visible) {
        mprint(Str1);
    }

    if(Level->site[m->x][m->y].aux == Player.patron) {
        if(visible) {
            mprint("Your diety is angry!");
            mprint("A bolt of godsfire strikes the monster...");
        }

        disrupt(m->x, m->y, Player.rank[PRIESTHOOD] * 50);
    }
    else if((Player.patron == ODIN) || (Player.patron == ATHENA)) {
        if((Level->site[m->x][m->y].aux == SET)
           || (Level->site[m->x][m->y].aux == HECATE)) {
            if(visible) {
                mprint("The deity of the altar smiles on the monster...");
                mprint("A shaft of light zaps the altar...");
            }

            m->hp = Monsters[m->id].hp * 2;
        }
        else if(visible) {
            mprint("but nothing much seems to happen");
        }
    }
    else if((Player.patron == SET) || (Player.patron == HECATE)) {
        if((Level->site[m->x][m->y].aux == ODIN)
           || (Level->site[m->x][m->y].aux == ATHENA)) {
            if(visible) {
                mprint("The deity of the altar smiiles on the monster...");
                mprint("A shaft of light zaps the altar...");
            }

            m->hp = Monsters[m->id].hp * 2;
        }
        else if(visible) {
            mprint("but nothing much seems to happen");
        }
    }
    else if(visible) {
        mprint("but nothing much seems to happen");
    }
}
Exemple #2
0
/* draws a particular spot under if in line-of-sight */
void drawspot(int x, int y)
{
  Symbol c;
  if (inbounds(x,y)) {
    c = getspot(x,y,FALSE);
    if (c != Level->site[x][y].showchar)
      if (view_los_p(Player.x,Player.y,x,y)) {
        lset(x,y,SEEN);
        Level->site[x][y].showchar = c;
        putspot(x,y,c);
      }
  }
}
Exemple #3
0
void drawvision(int x, int y)
{
  static int oldx = -1,oldy = -1;
  int i,j,c;

  if (Current_Environment != E_COUNTRYSIDE) {
    if (Player.status[BLINDED]) {
      drawspot(oldx,oldy);
      drawspot(x,y);
      drawplayer();
    }
    else {
      if (Player.status[ILLUMINATION] > 0) {
        for (i= -2;i<3;i++)
          for (j= -2;j<3;j++)
            if (inbounds(x+i,y+j))
              if (view_los_p(x+i,y+j,Player.x,Player.y))
                dodrawspot(x+i,y+j);
      }
      else {
        for (i= -1;i<2;i++)
          for (j= -1;j<2;j++)
            if (inbounds(x+i,y+j))
              dodrawspot(x+i,y+j);
      }
      drawplayer();
      drawmonsters(FALSE); /* erase all monsters */
      drawmonsters(TRUE);  /* draw those now visible */
    }
    if ((! gamestatusp(FAST_MOVE)) || (! optionp(JUMPMOVE)))
      omshowcursor(Player.x,Player.y);
    oldx = x;
    oldy = y;
  }
  else {
    for (i= -1;i<2;i++)
      for (j= -1;j<2;j++)
        if (inbounds(x+i,y+j)) {
          c_set(x+i, y+j, SEEN);
          if (!offscreen(x+i,y+j)) {
            wmove(Levelw,screenmody(y+j),screenmodx(x+i));
            c = Country[x+i][y+j].current_terrain_type;
            if (optionp(SHOW_COLOUR))
              wattrset(Levelw, CHARATTR(c));
            waddch(Levelw,(c&0xff));
          }
        }
    drawplayer();
    omshowcursor(Player.x,Player.y);
  }
}
Exemple #4
0
/* if display, displays monsters, otherwise erases them */
void drawmonsters(int display)
{
  pml ml;
  for (ml=Level->mlist;ml!=NULL;ml=ml->next) {
    if (ml->m->hp > 0) {
      if (display) {
        if (view_los_p(Player.x,Player.y,ml->m->x,ml->m->y)) {
          if (Player.status[TRUESIGHT] || (! m_statusp(ml->m,M_INVISIBLE))) {
            if (!optionp(SHOW_COLOUR) &&
                (ml->m->level > 5) &&
                ((ml->m->monchar&0xff) != '@') &&
                ((ml->m->monchar&0xff) != '|')) wstandout(Levelw);
            putspot(ml->m->x,ml->m->y,ml->m->monchar);
            if (!optionp(SHOW_COLOUR))
              wstandend(Levelw);
          }
        }
      }
      else erase_monster(ml->m);
    }
  }
}