Lines Matching refs:ship
100 static void recv_captain(struct ship *ship, const char *astr);
101 static void recv_captured(struct ship *ship, long a);
102 static void recv_class(struct ship *ship, long a);
103 static void recv_crew(struct ship *ship, long a, long b, long c);
104 static void recv_dbp(struct ship *ship, long a, long b, long c, long d);
105 static void recv_drift(struct ship *ship, long a);
106 static void recv_explode(struct ship *ship, long a);
107 static void recv_foul(struct ship *ship, long a);
108 static void recv_gunl(struct ship *ship, long a, long b);
109 static void recv_gunr(struct ship *ship, long a, long b);
110 static void recv_hull(struct ship *ship, long a);
111 static void recv_move(struct ship *ship, const char *astr);
112 static void recv_obp(struct ship *ship, long a, long b, long c, long d);
113 static void recv_pcrew(struct ship *ship, long a);
114 static void recv_unfoul(struct ship *ship, long a, long b);
115 static void recv_points(struct ship *ship, long a);
116 static void recv_qual(struct ship *ship, long a);
117 static void recv_ungrap(struct ship *ship, long a, long b);
118 static void recv_rigg(struct ship *ship, long a, long b, long c, long d);
119 static void recv_col(struct ship *ship, long a);
120 static void recv_dir(struct ship *ship, long a);
121 static void recv_row(struct ship *ship, long a);
122 static void recv_signal(struct ship *ship, const char *astr);
123 static void recv_sink(struct ship *ship, long a);
124 static void recv_struck(struct ship *ship, long a);
125 static void recv_ta(struct ship *ship, long a);
129 static void recv_fs(struct ship *ship, long a);
130 static void recv_grap(struct ship *ship, long a);
131 static void recv_rig1(struct ship *ship, long a);
132 static void recv_rig2(struct ship *ship, long a);
133 static void recv_rig3(struct ship *ship, long a);
134 static void recv_rig4(struct ship *ship, long a);
135 static void recv_begin(struct ship *ship);
136 static void recv_end(struct ship *ship);
139 static void Write(int, struct ship *, long, long, long, long);
140 static void Writestr(int, struct ship *, const char *);
142 static int sync_update(int, struct ship *, const char *,
169 fmtship(char *buf, size_t len, const char *fmt, struct ship *ship)
178 ship->shipname, colours(ship), sterncolour(ship));
194 makesignal(struct ship *from, const char *fmt, struct ship *ship, ...)
200 va_start(ap, ship);
201 fmtship(format, sizeof(format), fmt, ship);
209 makemsg(struct ship *from, const char *fmt, ...)
286 Write(int type, struct ship *ship, long a, long b, long c, long d)
289 int shipindex = (ship == NULL) ? 0 : ship->file->index;
298 sync_update(type, ship, NULL, a, b, c, d);
302 Writestr(int type, struct ship *ship, const char *a)
305 int shipindex = (ship == NULL) ? 0 : ship->file->index;
313 sync_update(type, ship, a, 0, 0, 0, 0);
399 if (sync_update(type, SHIP(shipnum), astr, a, b, c, d) < 0)
426 sync_update(int type, struct ship *ship, const char *astr,
430 case W_CAPTAIN: recv_captain(ship, astr); break;
431 case W_CAPTURED: recv_captured(ship, a); break;
432 case W_CLASS: recv_class(ship, a); break;
433 case W_CREW: recv_crew(ship, a, b, c); break;
434 case W_DBP: recv_dbp(ship, a, b, c, d); break;
435 case W_DRIFT: recv_drift(ship, a); break;
436 case W_EXPLODE: recv_explode(ship, a); break;
437 case W_FOUL: recv_foul(ship, a); break;
438 case W_GUNL: recv_gunl(ship, a, b); break;
439 case W_GUNR: recv_gunr(ship, a, b); break;
440 case W_HULL: recv_hull(ship, a); break;
441 case W_MOVE: recv_move(ship, astr); break;
442 case W_OBP: recv_obp(ship, a, b, c, d); break;
443 case W_PCREW: recv_pcrew(ship, a); break;
444 case W_UNFOUL: recv_unfoul(ship, a, b); break;
445 case W_POINTS: recv_points(ship, a); break;
446 case W_QUAL: recv_qual(ship, a); break;
447 case W_UNGRAP: recv_ungrap(ship, a, b); break;
448 case W_RIGG: recv_rigg(ship, a, b, c, d); break;
449 case W_COL: recv_col(ship, a); break;
450 case W_DIR: recv_dir(ship, a); break;
451 case W_ROW: recv_row(ship, a); break;
452 case W_SIGNAL: recv_signal(ship, astr); break;
453 case W_SINK: recv_sink(ship, a); break;
454 case W_STRUCK: recv_struck(ship, a); break;
455 case W_TA: recv_ta(ship, a); break;
459 case W_FS: recv_fs(ship, a); break;
460 case W_GRAP: recv_grap(ship, a); break;
461 case W_RIG1: recv_rig1(ship, a); break;
462 case W_RIG2: recv_rig2(ship, a); break;
463 case W_RIG3: recv_rig3(ship, a); break;
464 case W_RIG4: recv_rig4(ship, a); break;
465 case W_BEGIN: recv_begin(ship); break;
466 case W_END: recv_end(ship); break;
480 send_captain(struct ship *ship, const char *astr)
482 Writestr(W_CAPTAIN, ship, astr);
486 send_captured(struct ship *ship, long a)
488 Write(W_CAPTURED, ship, a, 0, 0, 0);
492 send_class(struct ship *ship, long a)
494 Write(W_CLASS, ship, a, 0, 0, 0);
498 send_crew(struct ship *ship, long a, long b, long c)
500 Write(W_CREW, ship, a, b, c, 0);
504 send_dbp(struct ship *ship, long a, long b, long c, long d)
506 Write(W_DBP, ship, a, b, c, d);
510 send_drift(struct ship *ship, long a)
512 Write(W_DRIFT, ship, a, 0, 0, 0);
516 send_explode(struct ship *ship, long a)
518 Write(W_EXPLODE, ship, a, 0, 0, 0);
522 send_foul(struct ship *ship, long a)
524 Write(W_FOUL, ship, a, 0, 0, 0);
528 send_gunl(struct ship *ship, long a, long b)
530 Write(W_GUNL, ship, a, b, 0, 0);
534 send_gunr(struct ship *ship, long a, long b)
536 Write(W_GUNR, ship, a, b, 0, 0);
540 send_hull(struct ship *ship, long a)
542 Write(W_HULL, ship, a, 0, 0, 0);
546 send_move(struct ship *ship, const char *astr)
548 Writestr(W_MOVE, ship, astr);
552 send_obp(struct ship *ship, long a, long b, long c, long d)
554 Write(W_OBP, ship, a, b, c, d);
558 send_pcrew(struct ship *ship, long a)
560 Write(W_PCREW, ship, a, 0, 0, 0);
564 send_unfoul(struct ship *ship, long a, long b)
566 Write(W_UNFOUL, ship, a, b, 0, 0);
570 send_points(struct ship *ship, long a)
572 Write(W_POINTS, ship, a, 0, 0, 0);
576 send_qual(struct ship *ship, long a)
578 Write(W_QUAL, ship, a, 0, 0, 0);
582 send_ungrap(struct ship *ship, long a, long b)
584 Write(W_UNGRAP, ship, a, b, 0, 0);
588 send_rigg(struct ship *ship, long a, long b, long c, long d)
590 Write(W_RIGG, ship, a, b, c, d);
594 send_col(struct ship *ship, long a)
596 Write(W_COL, ship, a, 0, 0, 0);
600 send_dir(struct ship *ship, long a)
602 Write(W_DIR, ship, a, 0, 0, 0);
606 send_row(struct ship *ship, long a)
608 Write(W_ROW, ship, a, 0, 0, 0);
612 send_signal(struct ship *ship, const char *astr)
614 Writestr(W_SIGNAL, ship, astr);
618 send_sink(struct ship *ship, long a)
620 Write(W_SINK, ship, a, 0, 0, 0);
624 send_struck(struct ship *ship, long a)
626 Write(W_STRUCK, ship, a, 0, 0, 0);
630 send_ta(struct ship *ship, long a)
632 Write(W_TA, ship, a, 0, 0, 0);
654 send_fs(struct ship *ship, long a)
656 Write(W_FS, ship, a, 0, 0, 0);
660 send_grap(struct ship *ship, long a)
662 Write(W_GRAP, ship, a, 0, 0, 0);
666 send_rig1(struct ship *ship, long a)
668 Write(W_RIG1, ship, a, 0, 0, 0);
672 send_rig2(struct ship *ship, long a)
674 Write(W_RIG2, ship, a, 0, 0, 0);
678 send_rig3(struct ship *ship, long a)
680 Write(W_RIG3, ship, a, 0, 0, 0);
684 send_rig4(struct ship *ship, long a)
686 Write(W_RIG4, ship, a, 0, 0, 0);
690 send_begin(struct ship *ship)
692 Write(W_BEGIN, ship, 0, 0, 0, 0);
696 send_end(struct ship *ship)
698 Write(W_END, ship, 0, 0, 0, 0);
713 recv_captain(struct ship *ship, const char *astr)
715 strlcpy(ship->file->captain, astr, sizeof ship->file->captain);
719 recv_captured(struct ship *ship, long a)
722 ship->file->captured = 0;
724 ship->file->captured = SHIP(a);
728 recv_class(struct ship *ship, long a)
730 ship->specs->class = a;
734 recv_crew(struct ship *ship, long a, long b, long c)
736 struct shipspecs *s = ship->specs;
744 recv_dbp(struct ship *ship, long a, long b, long c, long d)
746 ship->file->DBP[a];
749 p->toship = SHIP(c);
754 recv_drift(struct ship *ship, long a)
756 ship->file->drift = a;
760 recv_explode(struct ship *ship, long a)
762 if ((ship->file->explode = a) == 2)
763 ship->file->dir = 0;
767 recv_foul(struct ship *ship, long a)
769 struct snag *p = &ship->file->foul[a];
771 if (SHIP(a)->file->dir == 0)
775 ship->file->nfoul++;
779 recv_gunl(struct ship *ship, long a, long b)
781 struct shipspecs *s = ship->specs;
788 recv_gunr(struct ship *ship, long a, long b)
790 struct shipspecs *s = ship->specs;
797 recv_hull(struct ship *ship, long a)
799 ship->specs->hull = a;
803 recv_move(struct ship *ship, const char *astr)
805 strlcpy(ship->file->movebuf, astr, sizeof ship->file->movebuf);
809 recv_obp(struct ship *ship, long a, long b, long c, long d)
811 struct BP *p = &ship->file->OBP[a];
814 p->toship = SHIP(c);
819 recv_pcrew(struct ship *ship, long a)
821 ship->file->pcrew = a;
825 recv_unfoul(struct ship *ship, long a, long b)
827 struct snag *p = &ship->file->foul[a];
831 ship->file->nfoul -= p->sn_count;
834 ship->file->nfoul--;
841 recv_points(struct ship *ship, long a)
843 ship->file->points = a;
847 recv_qual(struct ship *ship, long a)
849 ship->specs->qual = a;
853 recv_ungrap(struct ship *ship, long a, long b)
855 struct snag *p = &ship->file->grap[a];
859 ship->file->ngrap -= p->sn_count;
862 ship->file->ngrap--;
869 recv_rigg(struct ship *ship, long a, long b, long c, long d)
871 struct shipspecs *s = ship->specs;
880 recv_col(struct ship *ship, long a)
882 ship->file->col = a;
886 recv_dir(struct ship *ship, long a)
888 ship->file->dir = a;
892 recv_row(struct ship *ship, long a)
894 ship->file->row = a;
898 recv_signal(struct ship *ship, const char *astr)
902 Signal("$$: %s", ship, astr);
904 Signal("\a$$: %s", ship, astr);
909 recv_sink(struct ship *ship, long a)
911 if ((ship->file->sink = a) == 2)
912 ship->file->dir = 0;
916 recv_struck(struct ship *ship, long a)
918 ship->file->struck = a;
922 recv_ta(struct ship *ship, long a)
924 ship->specs->ta = a;
947 recv_fs(struct ship *ship, long a)
949 ship->file->FS = a;
953 recv_grap(struct ship *ship, long a)
955 struct snag *p = &ship->file->grap[a];
957 if (SHIP(a)->file->dir == 0)
961 ship->file->ngrap++;
965 recv_rig1(struct ship *ship, long a)
967 ship->specs->rig1 = a;
971 recv_rig2(struct ship *ship, long a)
973 ship->specs->rig2 = a;
977 recv_rig3(struct ship *ship, long a)
979 ship->specs->rig3 = a;
983 recv_rig4(struct ship *ship, long a)
985 ship->specs->rig4 = a;
989 recv_begin(struct ship *ship)
991 strcpy(ship->file->captain, "begin");
996 recv_end(struct ship *ship)
998 *ship->file->captain = 0;
999 ship->file->points = 0;