1- /* $NetBSD: assorted.c,v 1.16 2009/03/14 19:35:13 dholland Exp $ */
1+ /* $NetBSD: assorted.c,v 1.17 2009/03/14 22:52:52 dholland Exp $ */
22
33/*
44 * Copyright (c) 1983, 1993
3434#if 0
3535static char sccsid [] = "@(#)assorted.c 8.2 (Berkeley) 4/28/95" ;
3636#else
37- __RCSID ("$NetBSD: assorted.c,v 1.16 2009/03/14 19:35:13 dholland Exp $" );
37+ __RCSID ("$NetBSD: assorted.c,v 1.17 2009/03/14 22:52:52 dholland Exp $" );
3838#endif
3939#endif /* not lint */
4040
@@ -133,19 +133,23 @@ table(struct ship *from, struct ship *on,
133133 ghits = 0 ;
134134 }
135135 hull -= ghits ;
136- if (Ghit )
137- Write (portside (from , on , 0 ) ? W_GUNR : W_GUNL ,
138- on , guns , car , 0 , 0 );
136+ if (Ghit ) {
137+ if (portside (from , on , 0 )) {
138+ send_gunr (on , guns , car );
139+ } else {
140+ send_gunl (on , guns , car );
141+ }
142+ }
139143 hull -= hhits ;
140144 hull = hull < 0 ? 0 : hull ;
141145 if (on -> file -> captured != 0 && Chit )
142- Write ( W_PCREW , on , pc , 0 , 0 , 0 );
146+ send_pcrew ( on , pc );
143147 if (Hhit )
144- Write ( W_HULL , on , hull , 0 , 0 , 0 );
148+ send_hull ( on , hull );
145149 if (Chit )
146- Write ( W_CREW , on , crew [0 ], crew [1 ], crew [2 ], 0 );
150+ send_crew ( on , crew [0 ], crew [1 ], crew [2 ]);
147151 if (Rhit )
148- Write ( W_RIGG , on , rigg [0 ], rigg [1 ], rigg [2 ], rigg [3 ]);
152+ send_rigg ( on , rigg [0 ], rigg [1 ], rigg [2 ], rigg [3 ]);
149153 switch (shot ) {
150154 case L_ROUND :
151155 message = "firing round shot on $$" ;
@@ -213,7 +217,7 @@ table(struct ship *from, struct ship *on,
213217 break ;
214218 case 5 :
215219 message = "rudder cables shot through" ;
216- Write ( W_TA , on , 0 , 0 , 0 , 0 );
220+ send_ta ( on , 0 );
217221 break ;
218222 case 6 :
219223 message = "shot holes below the water line" ;
@@ -245,12 +249,12 @@ void
245249Cleansnag (struct ship * from , struct ship * to , int all , int flag )
246250{
247251 if (flag & 1 ) {
248- Write ( W_UNGRAP , from , to -> file -> index , all , 0 , 0 );
249- Write ( W_UNGRAP , to , from -> file -> index , all , 0 , 0 );
252+ send_ungrap ( from , to -> file -> index , all );
253+ send_ungrap ( to , from -> file -> index , all );
250254 }
251255 if (flag & 2 ) {
252- Write ( W_UNFOUL , from , to -> file -> index , all , 0 , 0 );
253- Write ( W_UNFOUL , to , from -> file -> index , all , 0 , 0 );
256+ send_unfoul ( from , to -> file -> index , all );
257+ send_unfoul ( to , from -> file -> index , all );
254258 }
255259 if (!snagged2 (from , to )) {
256260 if (!snagged (from )) {
@@ -273,20 +277,20 @@ strike(struct ship *ship, struct ship *from)
273277
274278 if (ship -> file -> struck )
275279 return ;
276- Write ( W_STRUCK , ship , 1 , 0 , 0 , 0 );
280+ send_struck ( ship , 1 );
277281 points = ship -> specs -> pts + from -> file -> points ;
278- Write ( W_POINTS , from , points , 0 , 0 , 0 );
282+ send_points ( from , points );
279283 unboard (ship , ship , 0 ); /* all offense */
280284 unboard (ship , ship , 1 ); /* all defense */
281285 switch (dieroll ()) {
282286 case 3 :
283287 case 4 : /* ship may sink */
284- Write ( W_SINK , ship , 1 , 0 , 0 , 0 );
288+ send_sink ( ship , 1 );
285289 break ;
286290 case 5 :
287291 case 6 : /* ship may explode */
288- Write ( W_EXPLODE , ship , 1 , 0 , 0 , 0 );
292+ send_explode ( ship , 1 );
289293 break ;
290294 }
291- Writestr ( W_SIGNAL , ship , "striking her colours!" );
295+ send_signal ( ship , "striking her colours!" );
292296}
0 commit comments