void draw_stat(void) { wmove(stat_w, STAT_1, 0); wprintw(stat_w, "Points %3d\n", mf->points); wprintw(stat_w, "Fouls %2d\n", fouled(ms)); wprintw(stat_w, "Grapples %2d\n", grappled(ms)); wmove(stat_w, STAT_2, 0); wprintw(stat_w, " 0 %c(%c)\n", maxmove(ms, winddir + 3, -1) + '0', maxmove(ms, winddir + 3, 1) + '0'); waddstr(stat_w, " \\|/\n"); wprintw(stat_w, " -^-%c(%c)\n", maxmove(ms, winddir + 2, -1) + '0', maxmove(ms, winddir + 2, 1) + '0'); waddstr(stat_w, " /|\\\n"); wprintw(stat_w, " | %c(%c)\n", maxmove(ms, winddir + 1, -1) + '0', maxmove(ms, winddir + 1, 1) + '0'); wprintw(stat_w, " %c(%c)\n", maxmove(ms, winddir, -1) + '0', maxmove(ms, winddir, 1) + '0'); wmove(stat_w, STAT_3, 0); wprintw(stat_w, "Load %c%c %c%c\n", loadname[mf->loadL], readyname(mf->readyL), loadname[mf->loadR], readyname(mf->readyR)); wprintw(stat_w, "Hull %2d\n", mc->hull); wprintw(stat_w, "Crew %2d %2d %2d\n", mc->crew1, mc->crew2, mc->crew3); wprintw(stat_w, "Guns %2d %2d\n", mc->gunL, mc->gunR); wprintw(stat_w, "Carr %2d %2d\n", mc->carL, mc->carR); wprintw(stat_w, "Rigg %d %d %d ", mc->rig1, mc->rig2, mc->rig3); if (mc->rig4 < 0) waddch(stat_w, '-'); else wprintw(stat_w, "%d", mc->rig4); wrefresh(stat_w); }
checkup() { register int k, n, explode, sink; readpos(); for (n=0; n < scene[game].vessels; n++){ explode = scene[game].ship[n].file -> explode; sink = scene[game].ship[n].file -> sink; if (die() >= 5 && (explode == 1 || sink == 1)){ explode = 2; if (sink != 1) Write(FILES + n, 0, 232, explode); else Write(FILES + n, 0, 234, explode); pos[n].dir = 0; /* hopefully enough to kill ship */ Write(n, 0, 10, 0); if (fouled(n) || grappled(n)){ for (k=0; k < 10; k++){ if (scene[game].ship[n].file -> fouls[k].turnfoul) cleanfoul(n,scene[game].ship[n].file -> fouls[k].toship,k); } for (k=0; k < 10; k++){ if (scene[game].ship[n].file -> grapples[k].turnfoul) cleangrapple(n,scene[game].ship[n].file -> grapples[k].toship,k); } } if (sink != 1){ makesignal("exploding!", 0, n); for (k=0; k < scene[game].vessels; k++) if (k != n && pos[k].dir && range(n,k) < 4) table(RIGGING, EXPLODE, specs[scene[game].ship[n].shipnum].guns/13, k, n, 6); } else { makesignal("sinking!", 0, n); } } } }