1: /*
   2:  * Copyright (c) 1983 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: static char sccsid[] = "@(#)pl_2.c	5.1 (Berkeley) 5/29/85";
   9: #endif not lint
  10: 
  11: #include "player.h"
  12: 
  13: play()
  14: {
  15:     register struct ship *sp;
  16: 
  17:     for (;;) {
  18:         switch (sgetch("~\b", (struct ship *)0, 0)) {
  19:         case 'm':
  20:             acceptmove();
  21:             break;
  22:         case 's':
  23:             acceptsignal();
  24:             break;
  25:         case 'g':
  26:             grapungrap();
  27:             break;
  28:         case 'u':
  29:             unfoulplayer();
  30:             break;
  31:         case 'v':
  32:             Signal("%s", (struct ship *)0, version);
  33:             break;
  34:         case 'b':
  35:             acceptboard();
  36:             break;
  37:         case 'f':
  38:             acceptcombat();
  39:             break;
  40:         case 'l':
  41:             loadplayer();
  42:             break;
  43:         case 'c':
  44:             changesail();
  45:             break;
  46:         case 'r':
  47:             repair();
  48:             break;
  49:         case 'B':
  50:             Signal("'Hands to stations!'", (struct ship *)0);
  51:             unboard(ms, ms, 1); /* cancel DBP's */
  52:             unboard(ms, ms, 0); /* cancel offense */
  53:             break;
  54:         case '\f':
  55:             centerview();
  56:             blockalarm();
  57:             draw_board();
  58:             draw_screen();
  59:             unblockalarm();
  60:             break;
  61:         case 'L':
  62:             mf->loadL = L_EMPTY;
  63:             mf->loadR = L_EMPTY;
  64:             mf->readyL = R_EMPTY;
  65:             mf->readyR = R_EMPTY;
  66:             Signal("Broadsides unloaded", (struct ship *)0);
  67:             break;
  68:         case 'q':
  69:             Signal("Type 'Q' to quit", (struct ship *)0);
  70:             break;
  71:         case 'Q':
  72:             leave(LEAVE_QUIT);
  73:             break;
  74:         case 'I':
  75:             foreachship(sp)
  76:                 if (sp != ms)
  77:                     eyeball(sp);
  78:             break;
  79:         case 'i':
  80:             if ((sp = closestenemy(ms, 0, 1)) == 0)
  81:                 Signal("No more ships left.");
  82:             else
  83:                 eyeball(sp);
  84:             break;
  85:         case 'C':
  86:             centerview();
  87:             blockalarm();
  88:             draw_view();
  89:             unblockalarm();
  90:             break;
  91:         case 'U':
  92:             upview();
  93:             blockalarm();
  94:             draw_view();
  95:             unblockalarm();
  96:             break;
  97:         case 'D':
  98:         case 'N':
  99:             downview();
 100:             blockalarm();
 101:             draw_view();
 102:             unblockalarm();
 103:             break;
 104:         case 'H':
 105:             leftview();
 106:             blockalarm();
 107:             draw_view();
 108:             unblockalarm();
 109:             break;
 110:         case 'J':
 111:             rightview();
 112:             blockalarm();
 113:             draw_view();
 114:             unblockalarm();
 115:             break;
 116:         case 'F':
 117:             lookout();
 118:             break;
 119:         case 'S':
 120:             dont_adjust = !dont_adjust;
 121:             blockalarm();
 122:             draw_turn();
 123:             unblockalarm();
 124:             break;
 125:         }
 126:     }
 127: }

Defined functions

play defined in line 13; used 1 times

Defined variables

sccsid defined in line 8; never used
Last modified: 1985-05-30
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1049
Valid CSS Valid XHTML 1.0 Strict