static char *sccsid
= "@(#)assorted.c 1.1 83/03/17";
table(rig
, shot
, hittable
, onship
, fromship
, roll
)
int rig
, shot
, hittable
, onship
, fromship
, roll
;
register int hhits
= 0, chits
= 0, ghits
= 0, rhits
= 0;
int Ghit
= 0, Hhit
= 0, Rhit
= 0, Chit
= 0;
ptr
= &specs
[scene
[game
].ship
[onship
].shipnum
];
ptr1
= scene
[game
].ship
[onship
].file
;
Chit
= chits
= rig
? RigTable
[hittable
][roll
-1].C
: HullTable
[hittable
][roll
-1].C
;
Rhit
= rhits
= rig
? RigTable
[hittable
][roll
-1].R
: HullTable
[hittable
][roll
-1].R
;
Hhit
= hhits
= rig
? RigTable
[hittable
][roll
-1].H
: HullTable
[hittable
][roll
-1].H
;
Ghit
= ghits
= rig
? RigTable
[hittable
][roll
-1].G
: HullTable
[hittable
][roll
-1].G
;
if (ptr1
-> captured
> -1){
if (rigg
[3] != -1 && rhits
> rigg
[3]){
} else if (rigg
[3] != -1){
if (rig
&& !rigg
[2] && (!rigg
[3] || rigg
[3] == -1))
makesignal("dismasted!", 0, onship
);
if (portside(fromship
, onship
, 0)){
if (portside(fromship
, onship
, 0) && Ghit
){
Write(SPECS
+ onship
, 0, 20, guns
);
Write(SPECS
+ onship
, 0, 24, car
);
Write(SPECS
+ onship
, 0, 22, guns
);
Write(SPECS
+ onship
, 0, 26, car
);
hull
= hull
< 0 ? 0 : hull
;
if (ptr1
-> captured
> -1 && Chit
){
Write(FILES
+ onship
, 0, 70, pc
);
Write(SPECS
+ onship
, 0, 10, hull
);
Write(SPECS
+ onship
, 0, 14 + 2*n
, crew
[n
]);
Write(SPECS
+ onship
, 0, 28 + 2*n
, rigg
[n
]);
strcpy(message
, "firing round");
strcpy(message
, "firing grape");
strcpy(message
, "firing chain");
strcpy(message
, "firing double");
strcpy(message
, "exploding");
strcat(message
, " shot on %s (%c%c)");
makesignal(message
, onship
, fromship
);
strcpy(message
, "fore topsail sheets parted");
strcpy(message
, "mizzen shrouds parted");
strcpy(message
, "main topsail yard shot away");
strcpy(message
, "fore topmast and foremast shrouds shot away");
strcpy(message
, "mizzen mast and yard shot through");
strcpy(message
, "foremast and spritsail yard shattered");
strcpy(message
, "main topmast and mizzen mast shattered");
makesignal(message
, 0, onship
);
strcpy(message
, "anchor cables severed");
strcpy(message
, "two anchor stocks shot away");
strcpy(message
, "quarterdeck bulwarks damaged");
strcpy(message
, "three gun ports shot away");
strcpy(message
, "four guns dismounted");
strcpy(message
, "rudder cables shot through");
Write(SPECS
+ onship
, 0, 4, 0);
strcpy(message
, "shot holes below the water line");
makesignal(message
, 0, onship
);
if ((Chit
> 1 && ptr1
-> readyL
<= -30000 && ptr1
-> readyR
<= -30000) || Chit
== 4){
makesignal("crew mutinying!", 0, onship
);
Write(FILES
+ onship
, 0, 68, onship
);
makesignal("crew demoralized", 0, onship
);
Write(SPECS
+ onship
, 0, 12, ptr
-> qual
);
strike(onship
, fromship
);
cleanfoul(fromship
, toship
, offset
)
int fromship
, toship
, offset
;
Write(FILES
+ fromship
, 0, 84 + offset
*4, 0);
} while ((!scene
[game
].ship
[toship
].file
-> fouls
[n
].turnfoul
|| scene
[game
].ship
[toship
].file
-> fouls
[n
].toship
!= fromship
) && n
< 10);
Write(FILES
+ toship
, 0, 84 + 4*n
, 0);
if (!grapple(fromship
, toship
) && !foul(fromship
,toship
)){
if (!fouled(fromship
) && !grappled(fromship
)){
unboard(fromship
,fromship
, 1); /* defense */
unboard(fromship
,fromship
, 0); /* defense */
unboard(fromship
,toship
, 0); /* defense */
if (!fouled(toship
) && !grappled(toship
)){ /* defense */
unboard(toship
,toship
, 1);
unboard(toship
,toship
, 0);
unboard(toship
, fromship
, 0); /* offense */
cleangrapple(fromship
, toship
, offset
)
int fromship
, toship
, offset
;
Write(FILES
+ fromship
, 0, 124 + offset
*4, 0);
} while ((!scene
[game
].ship
[toship
].file
-> grapples
[n
].turnfoul
|| scene
[game
].ship
[toship
].file
-> grapples
[n
].toship
!= fromship
) && n
< 10);
Write(FILES
+ toship
, 0, 124 + 4*n
, 0);
if (!grapple(fromship
, toship
) && !foul(fromship
,toship
)){
if (!fouled(fromship
) && !grappled(fromship
)){
unboard(fromship
,fromship
, 1); /* defense */
unboard(fromship
,fromship
, 0); /* defense */
unboard(fromship
,toship
, 0); /* defense */
if (!fouled(toship
) && !grappled(toship
)){ /* defense */
unboard(toship
,toship
, 1);
unboard(toship
,toship
, 0);
unboard(toship
, fromship
, 0); /* offense */
strike(shipnum
, fromship
)
if (!scene
[game
].ship
[shipnum
].file
-> struck
){
Write(FILES
+ shipnum
, 0, 66, 1);
points
= specs
[scene
[game
].ship
[shipnum
].shipnum
].pts
+ scene
[game
].ship
[fromship
].file
-> points
;
Write(FILES
+ fromship
, 0, 20, points
);
unboard(shipnum
, shipnum
, 0); /* all offense */
unboard(shipnum
, shipnum
, 1); /* all defense */
case 4: /* ship may sink */
Write(FILES
+ shipnum
, 0, 234, 1);
case 6: /* ship may explode */
Write(FILES
+ shipnum
, 0, 232, 1);
Write(FILES
+ shipnum
, 1, 164, "striking her colours!");