* Copyright (c) 1985 Conrad C. Huang, Gregory S. Couch, Kenneth C.R.C. Arnold
* San Francisco, California
* Execute a single monitor command
ch
= pp
->p_cbuf
[pp
->p_ncount
++];
(void) strcpy(pp
->p_death
, "| Quit |");
* Execute a single command
ch
= pp
->p_cbuf
[pp
->p_ncount
++];
(void) strcpy(pp
->p_death
, "| Quit |");
fire(pp
, 1); /* GRENADE */
fire(pp
, 2); /* SATCHEL */
fire(pp
, 3); /* 7x7 BOMB */
fire(pp
, 4); /* 9x9 BOMB */
fire(pp
, 5); /* 11x11 BOMB */
fire(pp
, 6); /* 13x13 BOMB */
fire(pp
, 7); /* 15x15 BOMB */
fire(pp
, 8); /* 17x17 BOMB */
fire(pp
, 9); /* 19x19 BOMB */
fire(pp
, 10); /* 21x21 BOMB */
fire_slime(pp
, 0); /* SLIME */
fire_slime(pp
, 1); /* SSLIME */
(void) strcpy(pp
->p_death
, "| Quit |");
* Execute a move in the given direction
pickup(pp
, y
, x
, 2, Maze
[y
][x
]);
else if (opposite(dir
, pp
->p_face
))
pickup(pp
, y
, x
, 95, Maze
[y
][x
]);
pickup(pp
, y
, x
, 50, Maze
[y
][x
]);
checkdam(newp
, pp
, pp
->p_ident
, STABDAM
, KNIFE
);
message(newp
, "Oooh, there's a short guy waving at you!");
message(pp
, "You couldn't quite reach him!");
for (newp
= Boot
; newp
< &Boot
[NBOOTS
]; newp
++) {
if (newp
->p_y
== y
&& newp
->p_x
== x
) {
fixshots(y
, x
, newp
->p_over
);
message(pp
, "Wow! A pair of boots!");
message(pp
, "You can hobble around on one boot.");
if (--pp
->p_ncshot
== MAXNCSHOT
) {
cgoto(pp
, STAT_GUN_ROW
, STAT_VALUE_COL
);
fixshots(pp
->p_y
, pp
->p_x
, pp
->p_over
);
* Change the direction the player is facing
* Fire a shot of the given type in the given direction
if (req_index
< 0 || req_index
>= MAXBOMB
)
message(pp
, "What you do?");
while (req_index
>= 0 && pp
->p_ammo
< shot_req
[req_index
])
message(pp
, "Not enough charges.");
if (pp
->p_ncshot
> MAXNCSHOT
)
if (pp
->p_ncshot
++ == MAXNCSHOT
) {
cgoto(pp
, STAT_GUN_ROW
, STAT_VALUE_COL
);
pp
->p_ammo
-= shot_req
[req_index
];
(void) sprintf(Buf
, "%3d", pp
->p_ammo
);
cgoto(pp
, STAT_AMMO_ROW
, STAT_VALUE_COL
);
add_shot(shot_type
[req_index
], pp
->p_y
, pp
->p_x
, pp
->p_face
,
shot_req
[req_index
], pp
, FALSE
, pp
->p_face
);
* Show the object to everyone
showexpl(pp
->p_y
, pp
->p_x
, shot_type
[req_index
]);
for (pp
= Player
; pp
< End_player
; pp
++)
for (pp
= Monitor
; pp
< End_monitor
; pp
++)
* Fire a slime shot in the given direction
fire_slime(pp
, req_index
)
if (req_index
< 0 || req_index
>= MAXSLIME
)
message(pp
, "What you do?");
while (req_index
>= 0 && pp
->p_ammo
< slime_req
[req_index
])
message(pp
, "Not enough charges.");
if (pp
->p_ncshot
> MAXNCSHOT
)
if (pp
->p_ncshot
++ == MAXNCSHOT
) {
cgoto(pp
, STAT_GUN_ROW
, STAT_VALUE_COL
);
pp
->p_ammo
-= slime_req
[req_index
];
(void) sprintf(Buf
, "%3d", pp
->p_ammo
);
cgoto(pp
, STAT_AMMO_ROW
, STAT_VALUE_COL
);
add_shot(SLIME
, pp
->p_y
, pp
->p_x
, pp
->p_face
,
slime_req
[req_index
] * SLIME_FACTOR
, pp
, FALSE
, pp
->p_face
);
* Show the object to everyone
showexpl(pp
->p_y
, pp
->p_x
, SLIME
);
for (pp
= Player
; pp
< End_player
; pp
++)
for (pp
= Monitor
; pp
< End_monitor
; pp
++)
* Create a shot with the given properties
add_shot(type
, y
, x
, face
, charge
, owner
, expl
, over
)
for (size
= 3; size
< MAXBOMB
; size
++)
if (shot_req
[size
] >= charge
)
bp
= create_shot(type
, y
, x
, face
, charge
, size
, owner
,
(owner
== NULL
) ? NULL
: owner
->p_ident
, expl
, over
);
create_shot(type
, y
, x
, face
, charge
, size
, owner
, score
, expl
, over
)
bp
= (BULLET
*) malloc(sizeof (BULLET
)); /* NOSTRICT */
message(owner
, "Out of memory");
* Turn on or increase length of a cloak
message(pp
, "No more charges");
message(pp
, "Boots are too noisy to cloak!");
(void) sprintf(Buf
, "%3d", --pp
->p_ammo
);
cgoto(pp
, STAT_AMMO_ROW
, STAT_VALUE_COL
);
* Turn on or increase length of a scan
message(pp
, "No more charges");
(void) sprintf(Buf
, "%3d", --pp
->p_ammo
);
cgoto(pp
, STAT_AMMO_ROW
, STAT_VALUE_COL
);
* check whether the object blew up or whether he picked it up
pickup(pp
, y
, x
, prob
, obj
)
if (rand_num(100) < prob
)
add_shot(obj
, y
, x
, LEFTS
, req
, (PLAYER
*) NULL
,
(void) sprintf(Buf
, "%3d", pp
->p_ammo
);
cgoto(pp
, STAT_AMMO_ROW
, STAT_VALUE_COL
);