|
|
1.1 ! root 1: # include "trek.h" ! 2: ! 3: /** ! 4: ** damage control report ! 5: **/ ! 6: ! 7: dcrept() ! 8: { ! 9: register int i, f; ! 10: float x; ! 11: float m1, m2; ! 12: register EVENT *e; ! 13: ! 14: if (Status.cond == DOCKED) ! 15: { ! 16: m1 = 1.0 / Param.dockfac; ! 17: m2 = 1.0; ! 18: } ! 19: else ! 20: { ! 21: m1 = 1.0; ! 22: m2 = Param.dockfac; ! 23: } ! 24: printf("Damage control report:\t"); ! 25: f = 1; ! 26: for (i = 0; i < MAXEVENTS; i++) ! 27: { ! 28: e = &Event[i]; ! 29: if (e->evcode != E_FIXDV) ! 30: continue; ! 31: if (f) ! 32: { ! 33: printf(" repair times\n"); ! 34: printf(" in flight docked\n"); ! 35: f = 0; ! 36: } ! 37: x = e->date - Status.date; ! 38: printf("%-24s%7.2f %7.2f\n", ! 39: Device[e->systemname].name, x * m1 + 0.005, x * m2 + 0.005); ! 40: if (!Damage[e->systemname]) ! 41: syserr("Damage discrepancy device %d", ! 42: e->systemname); ! 43: } ! 44: if (f) ! 45: printf("all devices functional\n"); ! 46: } ! 47: ! 48: char *eout[] { ! 49: "snova", ! 50: "lrtb", ! 51: "katsb", ! 52: "kdesb", ! 53: "issue", ! 54: "enslv", ! 55: "repro", ! 56: "fixdv", ! 57: "attk", ! 58: "snap" ! 59: }; ! 60: ! 61: eventpr() ! 62: { ! 63: register int i; ! 64: register EVENT *e; ! 65: ! 66: Game.tourn=0; ! 67: for(i = 0; i < MAXEVENTS; i++) { ! 68: e = &Event[i]; ! 69: if(e->evcode<0) ! 70: continue; ! 71: printf("@ %.2f %s\t%d,%d,%d\n", e->date, eout[e->evcode&~E_NREPORT], e->x, e->y, e->evdata); ! 72: } ! 73: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.