|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1980 Regents of the University of California. ! 3: * All rights reserved. ! 4: * ! 5: * Redistribution and use in source and binary forms are permitted provided ! 6: * that: (1) source distributions retain this entire copyright notice and ! 7: * comment, and (2) distributions including binaries display the following ! 8: * acknowledgement: ``This product includes software developed by the ! 9: * University of California, Berkeley and its contributors'' in the ! 10: * documentation or other materials provided with the distribution and in ! 11: * all advertising materials mentioning features or use of this software. ! 12: * Neither the name of the University nor the names of its contributors may ! 13: * be used to endorse or promote products derived from this software without ! 14: * specific prior written permission. ! 15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 16: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 17: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 18: */ ! 19: ! 20: #ifndef lint ! 21: static char sccsid[] = "@(#)lose.c 5.6 (Berkeley) 6/26/90"; ! 22: #endif /* not lint */ ! 23: ! 24: # include "trek.h" ! 25: # include <setjmp.h> ! 26: ! 27: /* ! 28: ** PRINT OUT LOSER MESSAGES ! 29: ** ! 30: ** The messages are printed out, the score is computed and ! 31: ** printed, and the game is restarted. Oh yeh, any special ! 32: ** actions which need be taken are taken. ! 33: */ ! 34: ! 35: char *Losemsg[] = ! 36: { ! 37: "You ran out of time", ! 38: "You ran out of energy", ! 39: "You have been destroyed", ! 40: "You ran into the negative energy barrier", ! 41: "You destroyed yourself by nova'ing that star", ! 42: "You have been caught in a supernova", ! 43: "You just suffocated in outer space", ! 44: "You could not be rematerialized", ! 45: "\n\032\014 ***\07 Ship's hull has imploded\07 ***", ! 46: "You have burned up in a star", ! 47: "Well, you destroyed yourself, but it didn't do any good", ! 48: "You have been captured by Klingons and mercilessly tortured", ! 49: "Your last crew member died", ! 50: }; ! 51: ! 52: lose(why) ! 53: int why; ! 54: { ! 55: extern jmp_buf env; ! 56: ! 57: Game.killed = 1; ! 58: sleep(1); ! 59: printf("\n%s\n", Losemsg[why - 1]); ! 60: switch (why) ! 61: { ! 62: ! 63: case L_NOTIME: ! 64: Game.killed = 0; ! 65: break; ! 66: } ! 67: Move.endgame = -1; ! 68: score(); ! 69: skiptonl(0); ! 70: longjmp(env, 1); ! 71: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.