Advanced Rogue 5: convert to ANSI function declarations.
This still leaves over a thousand lines of warning messages, mostly related to the return types of daemons and fuses.
This commit is contained in:
parent
59f448e92e
commit
f38b2223c8
37 changed files with 977 additions and 733 deletions
|
|
@ -12,6 +12,7 @@
|
|||
* See the file LICENSE.TXT for full copyright and licensing information.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include "curses.h"
|
||||
|
|
@ -21,8 +22,8 @@
|
|||
|
||||
coord ch_ret; /* Where chasing takes you */
|
||||
|
||||
|
||||
|
||||
struct linked_list *get_hurl(struct thing *tp);
|
||||
bool straight_shot(int ery, int erx, int eey, int eex, coord *shooting);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -31,8 +32,7 @@ coord ch_ret; /* Where chasing takes you */
|
|||
*/
|
||||
|
||||
bool
|
||||
can_blink(tp)
|
||||
register struct thing *tp;
|
||||
can_blink(struct thing *tp)
|
||||
{
|
||||
register int y, x, index=9;
|
||||
coord tryp; /* To hold the coordinates for use in diag_ok */
|
||||
|
|
@ -128,8 +128,7 @@ register struct thing *tp;
|
|||
*/
|
||||
|
||||
coord *
|
||||
can_shoot(er, ee)
|
||||
register coord *er, *ee;
|
||||
can_shoot(coord *er, coord *ee)
|
||||
{
|
||||
static coord shoot_dir;
|
||||
|
||||
|
|
@ -154,13 +153,11 @@ register coord *er, *ee;
|
|||
* FALSE if we reach the goal.
|
||||
*/
|
||||
|
||||
chase(tp, ee, flee, mdead)
|
||||
register struct thing *tp;
|
||||
register coord *ee;
|
||||
bool flee; /* True if destination (ee) is player and monster is running away
|
||||
* or the player is in a wall and the monster can't get to it
|
||||
*/
|
||||
bool *mdead;
|
||||
/* flee: True if destination (ee) is player and monster is running
|
||||
* away or the player is in a wall and the monster can't get to it
|
||||
*/
|
||||
bool
|
||||
chase(struct thing *tp, coord *ee, bool flee, bool *mdead)
|
||||
{
|
||||
int damage, dist, thisdist, monst_dist = MAXINT;
|
||||
struct linked_list *weapon;
|
||||
|
|
@ -530,10 +527,10 @@ bool *mdead;
|
|||
* do_chase:
|
||||
* Make one thing chase another.
|
||||
*/
|
||||
/* flee: True if running away or player is inaccessible in wall */
|
||||
|
||||
do_chase(th, flee)
|
||||
register struct thing *th;
|
||||
register bool flee; /* True if running away or player is inaccessible in wall */
|
||||
void
|
||||
do_chase(struct thing *th, bool flee)
|
||||
{
|
||||
register struct room *rer, *ree, /* room of chaser, room of chasee */
|
||||
*orig_rer, /* Original room of chaser */
|
||||
|
|
@ -830,8 +827,7 @@ register bool flee; /* True if running away or player is inaccessible in wall */
|
|||
*/
|
||||
|
||||
struct linked_list *
|
||||
get_hurl(tp)
|
||||
register struct thing *tp;
|
||||
get_hurl(struct thing *tp)
|
||||
{
|
||||
struct linked_list *arrow, *bolt, *rock;
|
||||
register struct linked_list *pitem;
|
||||
|
|
@ -861,7 +857,8 @@ register struct thing *tp;
|
|||
* Make all the running monsters move.
|
||||
*/
|
||||
|
||||
runners()
|
||||
void
|
||||
runners(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct thing *tp = NULL;
|
||||
|
|
@ -935,9 +932,8 @@ runners()
|
|||
* Set a monster running after something
|
||||
*/
|
||||
|
||||
runto(runner, spot)
|
||||
register struct thing *runner;
|
||||
coord *spot;
|
||||
void
|
||||
runto(struct thing *runner, coord *spot)
|
||||
{
|
||||
/*
|
||||
* Start the beastie running
|
||||
|
|
@ -959,9 +955,7 @@ coord *spot;
|
|||
*/
|
||||
|
||||
bool
|
||||
straight_shot(ery, erx, eey, eex, shooting)
|
||||
register int ery, erx, eey, eex;
|
||||
register coord *shooting;
|
||||
straight_shot(int ery, int erx, int eey, int eex, coord *shooting)
|
||||
{
|
||||
register int dy, dx; /* Deltas */
|
||||
char ch;
|
||||
|
|
|
|||
|
|
@ -21,12 +21,20 @@
|
|||
#include "rogue.h"
|
||||
#include "mach_dep.h"
|
||||
|
||||
void help(void);
|
||||
void identify(void);
|
||||
void d_level(void);
|
||||
void u_level(void);
|
||||
void shell(void);
|
||||
void call(bool mark);
|
||||
|
||||
/*
|
||||
* command:
|
||||
* Process the user commands
|
||||
*/
|
||||
|
||||
command()
|
||||
void
|
||||
command(void)
|
||||
{
|
||||
register char ch;
|
||||
register int ntimes = 1; /* Number of player moves */
|
||||
|
|
@ -207,8 +215,8 @@ command()
|
|||
when 'I' : after = FALSE; picky_inven();
|
||||
when 'd' : drop(NULL);
|
||||
when 'P' : grab(hero.y, hero.x);
|
||||
when 'q' : quaff(-1, NULL, TRUE);
|
||||
when 'r' : read_scroll(-1, NULL, TRUE);
|
||||
when 'q' : quaff(-1, 0, TRUE);
|
||||
when 'r' : read_scroll(-1, 0, TRUE);
|
||||
when 'e' : eat();
|
||||
when 'w' : wield();
|
||||
when 'W' : wear();
|
||||
|
|
@ -228,7 +236,7 @@ command()
|
|||
when 'G' : gsense();
|
||||
when '^' : set_trap(&player, hero.y, hero.x);
|
||||
when 's' : search(FALSE, FALSE);
|
||||
when 'z' : if (!do_zap(TRUE, NULL, FALSE))
|
||||
when 'z' : if (!do_zap(TRUE, 0, FALSE))
|
||||
after=FALSE;
|
||||
when 'p' : pray();
|
||||
when 'C' : cast();
|
||||
|
|
@ -475,8 +483,7 @@ quit(int sig)
|
|||
*/
|
||||
|
||||
void
|
||||
bugkill(sig)
|
||||
int sig;
|
||||
bugkill(int sig)
|
||||
{
|
||||
signal(sig, quit); /* If we get it again, give up */
|
||||
death(D_SIGNAL); /* Killed by a bug */
|
||||
|
|
@ -488,8 +495,8 @@ int sig;
|
|||
* Player gropes about him to find hidden things.
|
||||
*/
|
||||
|
||||
search(is_thief, door_chime)
|
||||
register bool is_thief, door_chime;
|
||||
void
|
||||
search(bool is_thief, bool door_chime)
|
||||
{
|
||||
register int x, y;
|
||||
register char ch, /* The trap or door character */
|
||||
|
|
@ -570,7 +577,8 @@ register bool is_thief, door_chime;
|
|||
* Give single character help, or the whole mess if he wants it
|
||||
*/
|
||||
|
||||
help()
|
||||
void
|
||||
help(void)
|
||||
{
|
||||
register struct h_list *strp = helpstr;
|
||||
#ifdef WIZARD
|
||||
|
|
@ -664,7 +672,8 @@ help()
|
|||
* Tell the player what a certain thing is.
|
||||
*/
|
||||
|
||||
identify()
|
||||
void
|
||||
identify(void)
|
||||
{
|
||||
register char ch;
|
||||
const char *str;
|
||||
|
|
@ -726,7 +735,8 @@ identify()
|
|||
* He wants to go down a level
|
||||
*/
|
||||
|
||||
d_level()
|
||||
void
|
||||
d_level(void)
|
||||
{
|
||||
bool no_phase=FALSE;
|
||||
|
||||
|
|
@ -770,7 +780,8 @@ d_level()
|
|||
* He wants to go up a level
|
||||
*/
|
||||
|
||||
u_level()
|
||||
void
|
||||
u_level(void)
|
||||
{
|
||||
bool no_phase = FALSE;
|
||||
register struct linked_list *item;
|
||||
|
|
@ -828,7 +839,8 @@ u_level()
|
|||
* Let him escape for a while
|
||||
*/
|
||||
|
||||
shell()
|
||||
void
|
||||
shell(void)
|
||||
{
|
||||
/*
|
||||
* Set the terminal back to original mode
|
||||
|
|
@ -859,8 +871,8 @@ shell()
|
|||
/*
|
||||
* allow a user to call a potion, scroll, or ring something
|
||||
*/
|
||||
call(mark)
|
||||
bool mark;
|
||||
void
|
||||
call(bool mark)
|
||||
{
|
||||
register struct object *obj;
|
||||
register struct linked_list *item;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ int fusecnt = 0;
|
|||
* Find an empty slot in the daemon list
|
||||
*/
|
||||
struct delayed_action *
|
||||
d_slot()
|
||||
d_slot(void)
|
||||
{
|
||||
reg int i;
|
||||
reg struct delayed_action *dev;
|
||||
|
|
@ -52,7 +52,7 @@ d_slot()
|
|||
* Find an empty slot in the fuses list
|
||||
*/
|
||||
struct delayed_action *
|
||||
f_slot()
|
||||
f_slot(void)
|
||||
{
|
||||
reg int i;
|
||||
reg struct delayed_action *dev;
|
||||
|
|
@ -70,8 +70,7 @@ f_slot()
|
|||
* Find a particular slot in the table
|
||||
*/
|
||||
struct delayed_action *
|
||||
find_slot(func)
|
||||
reg int (*func)();
|
||||
find_slot(int (*func)())
|
||||
{
|
||||
reg int i;
|
||||
reg struct delayed_action *dev;
|
||||
|
|
@ -87,6 +86,7 @@ reg int (*func)();
|
|||
* start_daemon:
|
||||
* Start a daemon, takes a function.
|
||||
*/
|
||||
void
|
||||
start_daemon(int (*func)(), void *arg, int type)
|
||||
{
|
||||
reg struct delayed_action *dev;
|
||||
|
|
@ -106,8 +106,8 @@ start_daemon(int (*func)(), void *arg, int type)
|
|||
* kill_daemon:
|
||||
* Remove a daemon from the list
|
||||
*/
|
||||
kill_daemon(func)
|
||||
reg int (*func)();
|
||||
void
|
||||
kill_daemon(int (*func)())
|
||||
{
|
||||
reg struct delayed_action *dev;
|
||||
reg int i;
|
||||
|
|
@ -133,8 +133,8 @@ reg int (*func)();
|
|||
* Run all the daemons that are active with the current flag,
|
||||
* passing the argument to the function.
|
||||
*/
|
||||
do_daemons(flag)
|
||||
reg int flag;
|
||||
void
|
||||
do_daemons(int flag)
|
||||
{
|
||||
reg struct delayed_action *dev;
|
||||
|
||||
|
|
@ -154,6 +154,7 @@ reg int flag;
|
|||
* fuse:
|
||||
* Start a fuse to go off in a certain number of turns
|
||||
*/
|
||||
void
|
||||
fuse(int (*func)(), void *arg, int time, int type)
|
||||
{
|
||||
reg struct delayed_action *wire;
|
||||
|
|
@ -173,8 +174,8 @@ fuse(int (*func)(), void *arg, int time, int type)
|
|||
* lengthen:
|
||||
* Increase the time until a fuse goes off
|
||||
*/
|
||||
lengthen(func, xtime)
|
||||
reg int (*func)(), xtime;
|
||||
void
|
||||
lengthen(int (*func)(), int xtime)
|
||||
{
|
||||
reg struct delayed_action *wire;
|
||||
|
||||
|
|
@ -188,8 +189,8 @@ reg int (*func)(), xtime;
|
|||
* extinguish:
|
||||
* Put out a fuse
|
||||
*/
|
||||
extinguish(func)
|
||||
reg int (*func)();
|
||||
void
|
||||
extinguish(int (*func)())
|
||||
{
|
||||
reg struct delayed_action *wire;
|
||||
|
||||
|
|
@ -207,8 +208,8 @@ reg int (*func)();
|
|||
* do_fuses:
|
||||
* Decrement counters and start needed fuses
|
||||
*/
|
||||
do_fuses(flag)
|
||||
reg int flag;
|
||||
void
|
||||
do_fuses(int flag)
|
||||
{
|
||||
reg struct delayed_action *wire;
|
||||
|
||||
|
|
@ -234,7 +235,8 @@ reg int flag;
|
|||
* activity:
|
||||
* Show wizard number of demaons and memory blocks used
|
||||
*/
|
||||
activity()
|
||||
void
|
||||
activity(void)
|
||||
{
|
||||
sprintf(outstring,"Daemons = %d : Fuses = %d : Memory Items = %d : Memory Used = %d",
|
||||
demoncnt,fusecnt,total,md_memused());
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ int between = 0;
|
|||
* A healing daemon that restors hit points after rest
|
||||
*/
|
||||
|
||||
doctor(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
doctor(struct thing *tp)
|
||||
{
|
||||
register int ohp;
|
||||
register int limit, new_points;
|
||||
|
|
@ -100,7 +100,8 @@ register struct thing *tp;
|
|||
* Called when it is time to start rolling for wandering monsters
|
||||
*/
|
||||
|
||||
swander()
|
||||
void
|
||||
swander(void)
|
||||
{
|
||||
start_daemon(rollwand, 0, BEFORE);
|
||||
}
|
||||
|
|
@ -110,7 +111,8 @@ swander()
|
|||
* Called to roll to see if a wandering monster starts up
|
||||
*/
|
||||
|
||||
rollwand()
|
||||
void
|
||||
rollwand(void)
|
||||
{
|
||||
if (++between >= 4)
|
||||
{
|
||||
|
|
@ -128,7 +130,8 @@ rollwand()
|
|||
/*
|
||||
* this function is a daemon called each turn when the character is a thief
|
||||
*/
|
||||
trap_look()
|
||||
void
|
||||
trap_look(void)
|
||||
{
|
||||
if (rnd(100) < (2*dex_compute() + 5*pstats.s_lvl))
|
||||
search(TRUE, FALSE);
|
||||
|
|
@ -139,7 +142,8 @@ trap_look()
|
|||
* Release the poor player from his confusion
|
||||
*/
|
||||
|
||||
unconfuse()
|
||||
void
|
||||
unconfuse(void)
|
||||
{
|
||||
turn_off(player, ISHUH);
|
||||
msg("You feel less confused now");
|
||||
|
|
@ -151,7 +155,8 @@ unconfuse()
|
|||
* He lost his see invisible power
|
||||
*/
|
||||
|
||||
unsee()
|
||||
void
|
||||
unsee(void)
|
||||
{
|
||||
if (!ISWEARING(R_SEEINVIS)) {
|
||||
turn_off(player, CANSEE);
|
||||
|
|
@ -164,7 +169,8 @@ unsee()
|
|||
* Remove to-hit handicap from player
|
||||
*/
|
||||
|
||||
unstink()
|
||||
void
|
||||
unstink(void)
|
||||
{
|
||||
turn_off(player, HASSTINK);
|
||||
}
|
||||
|
|
@ -174,7 +180,8 @@ unstink()
|
|||
* Player is no longer immune to confusion
|
||||
*/
|
||||
|
||||
unclrhead()
|
||||
void
|
||||
unclrhead(void)
|
||||
{
|
||||
turn_off(player, ISCLEAR);
|
||||
msg("The blue aura about your head fades away.");
|
||||
|
|
@ -185,7 +192,8 @@ unclrhead()
|
|||
* Player can no longer walk through walls
|
||||
*/
|
||||
|
||||
unphase()
|
||||
void
|
||||
unphase(void)
|
||||
{
|
||||
turn_off(player, CANINWALL);
|
||||
msg("Your dizzy feeling leaves you.");
|
||||
|
|
@ -197,7 +205,8 @@ unphase()
|
|||
* Player can no longer fly
|
||||
*/
|
||||
|
||||
land()
|
||||
void
|
||||
land(void)
|
||||
{
|
||||
turn_off(player, ISFLY);
|
||||
msg("You regain your normal weight");
|
||||
|
|
@ -209,7 +218,8 @@ land()
|
|||
* He gets his sight back
|
||||
*/
|
||||
|
||||
sight()
|
||||
void
|
||||
sight(void)
|
||||
{
|
||||
if (on(player, ISBLIND))
|
||||
{
|
||||
|
|
@ -225,7 +235,8 @@ sight()
|
|||
* Restore player's strength
|
||||
*/
|
||||
|
||||
res_strength()
|
||||
void
|
||||
res_strength(void)
|
||||
{
|
||||
|
||||
/* If lost_str is non-zero, restore that amount of strength,
|
||||
|
|
@ -249,7 +260,8 @@ res_strength()
|
|||
* End the hasting
|
||||
*/
|
||||
|
||||
nohaste()
|
||||
void
|
||||
nohaste(void)
|
||||
{
|
||||
turn_off(player, ISHASTE);
|
||||
msg("You feel yourself slowing down.");
|
||||
|
|
@ -260,7 +272,8 @@ nohaste()
|
|||
* End the slowing
|
||||
*/
|
||||
|
||||
noslow()
|
||||
void
|
||||
noslow(void)
|
||||
{
|
||||
turn_off(player, ISSLOW);
|
||||
msg("You feel yourself speeding up.");
|
||||
|
|
@ -271,7 +284,8 @@ noslow()
|
|||
* If this gets called, the player has suffocated
|
||||
*/
|
||||
|
||||
suffocate()
|
||||
void
|
||||
suffocate(void)
|
||||
{
|
||||
death(D_SUFFOCATION);
|
||||
}
|
||||
|
|
@ -279,7 +293,8 @@ suffocate()
|
|||
/*
|
||||
* digest the hero's food
|
||||
*/
|
||||
stomach()
|
||||
void
|
||||
stomach(void)
|
||||
{
|
||||
register int oldfood, old_hunger, food_use, i;
|
||||
|
||||
|
|
@ -335,7 +350,8 @@ stomach()
|
|||
/*
|
||||
* daemon for curing the diseased
|
||||
*/
|
||||
cure_disease()
|
||||
void
|
||||
cure_disease(void)
|
||||
{
|
||||
turn_off(player, HASDISEASE);
|
||||
if (off (player, HASINFEST))
|
||||
|
|
@ -346,7 +362,8 @@ cure_disease()
|
|||
/*
|
||||
* daemon for adding back dexterity
|
||||
*/
|
||||
un_itch()
|
||||
void
|
||||
un_itch(void)
|
||||
{
|
||||
if (--lost_dext < 1) {
|
||||
lost_dext = 0;
|
||||
|
|
@ -358,7 +375,8 @@ un_itch()
|
|||
* appear:
|
||||
* Become visible again
|
||||
*/
|
||||
appear()
|
||||
void
|
||||
appear(void)
|
||||
{
|
||||
turn_off(player, ISINVIS);
|
||||
PLAYER = VPLAYER;
|
||||
|
|
@ -369,7 +387,8 @@ appear()
|
|||
* dust_appear:
|
||||
* dust of disappearance wears off
|
||||
*/
|
||||
dust_appear()
|
||||
void
|
||||
dust_appear(void)
|
||||
{
|
||||
turn_off(player, ISINVIS);
|
||||
PLAYER = VPLAYER;
|
||||
|
|
@ -380,7 +399,8 @@ dust_appear()
|
|||
* unchoke:
|
||||
* the effects of "dust of choking and sneezing" wear off
|
||||
*/
|
||||
unchoke()
|
||||
void
|
||||
unchoke(void)
|
||||
{
|
||||
if (!find_slot(unconfuse))
|
||||
turn_off(player, ISHUH);
|
||||
|
|
@ -392,8 +412,8 @@ unchoke()
|
|||
/*
|
||||
* make some potion for the guy in the Alchemy jug
|
||||
*/
|
||||
alchemy(obj)
|
||||
register struct object *obj;
|
||||
void
|
||||
alchemy(struct object *obj)
|
||||
{
|
||||
register struct object *tobj = NULL;
|
||||
register struct linked_list *item;
|
||||
|
|
@ -440,7 +460,8 @@ register struct object *obj;
|
|||
* otto's irresistable dance wears off
|
||||
*/
|
||||
|
||||
undance()
|
||||
void
|
||||
undance(void)
|
||||
{
|
||||
turn_off(player, ISDANCE);
|
||||
msg ("Your feet take a break.....whew!");
|
||||
|
|
@ -449,14 +470,16 @@ undance()
|
|||
/*
|
||||
* if he has our favorite necklace of strangulation then take damage every turn
|
||||
*/
|
||||
strangle()
|
||||
void
|
||||
strangle(void)
|
||||
{
|
||||
if ((pstats.s_hpt -= 6) <= 0) death(D_STRANGLE);
|
||||
}
|
||||
/*
|
||||
* if he has on the gauntlets of fumbling he might drop his weapon each turn
|
||||
*/
|
||||
fumble()
|
||||
void
|
||||
fumble(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
|
||||
|
|
@ -474,14 +497,16 @@ fumble()
|
|||
/*
|
||||
* this is called each turn the hero has the ring of searching on
|
||||
*/
|
||||
ring_search()
|
||||
void
|
||||
ring_search(void)
|
||||
{
|
||||
search(FALSE, FALSE);
|
||||
}
|
||||
/*
|
||||
* this is called each turn the hero has the ring of teleportation on
|
||||
*/
|
||||
ring_teleport()
|
||||
void
|
||||
ring_teleport(void)
|
||||
{
|
||||
if (rnd(100) < 2) teleport();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,14 @@
|
|||
#include "curses.h"
|
||||
#include "rogue.h"
|
||||
|
||||
int packweight(void);
|
||||
|
||||
/*
|
||||
* updpack:
|
||||
* Update his pack weight and adjust fooduse accordingly
|
||||
*/
|
||||
updpack(getmax)
|
||||
int getmax;
|
||||
void
|
||||
updpack(bool getmax)
|
||||
{
|
||||
|
||||
reg int topcarry, curcarry;
|
||||
|
|
@ -45,7 +47,8 @@ int getmax;
|
|||
* packweight:
|
||||
* Get the total weight of the hero's pack
|
||||
*/
|
||||
packweight()
|
||||
int
|
||||
packweight(void)
|
||||
{
|
||||
reg struct object *obj;
|
||||
reg struct linked_list *pc;
|
||||
|
|
@ -68,8 +71,8 @@ packweight()
|
|||
* itemweight:
|
||||
* Get the weight of an object
|
||||
*/
|
||||
itemweight(wh)
|
||||
reg struct object *wh;
|
||||
int
|
||||
itemweight(struct object *wh)
|
||||
{
|
||||
reg int weight;
|
||||
reg int ac;
|
||||
|
|
@ -99,7 +102,8 @@ reg struct object *wh;
|
|||
* playenc:
|
||||
* Get hero's carrying ability above norm
|
||||
*/
|
||||
playenc()
|
||||
int
|
||||
playenc(void)
|
||||
{
|
||||
return ((str_compute()-8)*50);
|
||||
}
|
||||
|
|
@ -109,7 +113,8 @@ playenc()
|
|||
* totalenc:
|
||||
* Get total weight that the hero can carry
|
||||
*/
|
||||
totalenc()
|
||||
int
|
||||
totalenc(void)
|
||||
{
|
||||
reg int wtotal;
|
||||
|
||||
|
|
@ -130,18 +135,18 @@ totalenc()
|
|||
* See if the hero can carry his pack
|
||||
*/
|
||||
|
||||
wghtchk()
|
||||
void
|
||||
wghtchk(void)
|
||||
{
|
||||
reg int dropchk, err = TRUE;
|
||||
reg char ch;
|
||||
int wghtchk();
|
||||
|
||||
inwhgt = TRUE;
|
||||
if (pstats.s_pack > pstats.s_carry) {
|
||||
ch = CCHAR( mvwinch(stdscr, hero.y, hero.x) );
|
||||
if((ch != FLOOR && ch != PASSAGE)) {
|
||||
extinguish(wghtchk);
|
||||
fuse(wghtchk,TRUE,1,AFTER);
|
||||
fuse(wghtchk,NULL,1,AFTER);
|
||||
inwhgt = FALSE;
|
||||
return;
|
||||
}
|
||||
|
|
@ -169,7 +174,8 @@ wghtchk()
|
|||
* -1 hit for heavy pack weight
|
||||
*/
|
||||
|
||||
hitweight()
|
||||
int
|
||||
hitweight(void)
|
||||
{
|
||||
return(2 - foodlev);
|
||||
}
|
||||
|
|
|
|||
122
arogue5/fight.c
122
arogue5/fight.c
|
|
@ -13,10 +13,27 @@
|
|||
*/
|
||||
|
||||
#include "curses.h"
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "rogue.h"
|
||||
|
||||
bool roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
|
||||
bool hurl, struct object *cur_weapon, bool back_stab);
|
||||
void hit(struct object *weapon, struct thing *tp, char *er, char *ee,
|
||||
bool back_stab);
|
||||
void miss(struct object *weapon, struct thing *tp, char *er, char *ee);
|
||||
int dext_plus(int dexterity);
|
||||
int str_plus(short str);
|
||||
int add_dam(short str);
|
||||
int hung_dam(void);
|
||||
void thunk(struct object *weap, struct thing *tp, char *mname);
|
||||
void m_thunk(struct object *weap, struct thing *tp, char *mname);
|
||||
void bounce(struct object *weap, struct thing *tp, char *mname);
|
||||
void m_bounce(struct object *weap, struct thing *tp, char *mname);
|
||||
struct object *wield_weap(struct object *thrown, struct thing *mp);
|
||||
void explode(struct thing *tp);
|
||||
|
||||
#define CONF_DAMAGE -1
|
||||
#define PARAL_DAMAGE -2
|
||||
#define DEST_DAMAGE -3
|
||||
|
|
@ -35,10 +52,8 @@ static const struct matrix att_mat[5] = {
|
|||
* The player attacks the monster.
|
||||
*/
|
||||
|
||||
fight(mp, weap, thrown)
|
||||
register coord *mp;
|
||||
struct object *weap;
|
||||
bool thrown;
|
||||
bool
|
||||
fight(coord *mp, struct object *weap, bool thrown)
|
||||
{
|
||||
register struct thing *tp;
|
||||
register struct linked_list *item;
|
||||
|
|
@ -204,10 +219,8 @@ bool thrown;
|
|||
* The monster attacks the player
|
||||
*/
|
||||
|
||||
attack(mp, weapon, thrown)
|
||||
register struct thing *mp;
|
||||
register struct object *weapon;
|
||||
bool thrown;
|
||||
bool
|
||||
attack(struct thing *mp, struct object *weapon, bool thrown)
|
||||
{
|
||||
register const char *mname;
|
||||
register bool did_hit = FALSE;
|
||||
|
|
@ -708,9 +721,8 @@ bool thrown;
|
|||
* returns true if the swing hits
|
||||
*/
|
||||
|
||||
swing(class, at_lvl, op_arm, wplus)
|
||||
short class;
|
||||
int at_lvl, op_arm, wplus;
|
||||
bool
|
||||
swing(short class, int at_lvl, int op_arm, int wplus)
|
||||
{
|
||||
register int res = rnd(20)+1;
|
||||
register int need;
|
||||
|
|
@ -730,12 +742,9 @@ int at_lvl, op_arm, wplus;
|
|||
* Roll several attacks
|
||||
*/
|
||||
|
||||
roll_em(att_er, def_er, weap, hurl, cur_weapon, back_stab)
|
||||
struct thing *att_er, *def_er;
|
||||
struct object *weap;
|
||||
bool hurl;
|
||||
struct object *cur_weapon;
|
||||
bool back_stab;
|
||||
bool
|
||||
roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
|
||||
bool hurl, struct object *cur_weapon, bool back_stab)
|
||||
{
|
||||
register struct stats *att, *def;
|
||||
register char *cp = NULL;
|
||||
|
|
@ -1028,9 +1037,7 @@ bool back_stab;
|
|||
*/
|
||||
|
||||
char *
|
||||
prname(who, upper)
|
||||
register char *who;
|
||||
bool upper;
|
||||
prname(char *who, bool upper)
|
||||
{
|
||||
static char tbuf[LINELEN];
|
||||
|
||||
|
|
@ -1054,11 +1061,8 @@ bool upper;
|
|||
* Print a message to indicate a succesful hit
|
||||
*/
|
||||
|
||||
hit(weapon, tp, er, ee, back_stab)
|
||||
register struct object *weapon;
|
||||
register struct thing *tp;
|
||||
register char *er, *ee;
|
||||
bool back_stab;
|
||||
void
|
||||
hit(struct object *weapon, struct thing *tp, char *er, char *ee, bool back_stab)
|
||||
{
|
||||
register char *s = NULL;
|
||||
char
|
||||
|
|
@ -1114,10 +1118,8 @@ bool back_stab;
|
|||
* Print a message to indicate a poor swing
|
||||
*/
|
||||
|
||||
miss(weapon, tp, er, ee)
|
||||
register struct object *weapon;
|
||||
register struct thing *tp;
|
||||
register char *er, *ee;
|
||||
void
|
||||
miss(struct object *weapon, struct thing *tp, char *er, char *ee)
|
||||
{
|
||||
register char *s = NULL;
|
||||
char
|
||||
|
|
@ -1161,8 +1163,8 @@ register char *er, *ee;
|
|||
* compute to-hit bonus for dexterity
|
||||
*/
|
||||
|
||||
dext_plus(dexterity)
|
||||
register int dexterity;
|
||||
int
|
||||
dext_plus(int dexterity)
|
||||
{
|
||||
return (dexterity > 10 ? (dexterity-13)/3 : (dexterity-10)/3);
|
||||
}
|
||||
|
|
@ -1173,8 +1175,8 @@ register int dexterity;
|
|||
* compute armor class bonus for dexterity
|
||||
*/
|
||||
|
||||
dext_prot(dexterity)
|
||||
register int dexterity;
|
||||
int
|
||||
dext_prot(int dexterity)
|
||||
{
|
||||
return ((dexterity-10)/2);
|
||||
}
|
||||
|
|
@ -1183,8 +1185,8 @@ register int dexterity;
|
|||
* compute bonus/penalties for strength on the "to hit" roll
|
||||
*/
|
||||
|
||||
str_plus(str)
|
||||
register short str;
|
||||
int
|
||||
str_plus(short str)
|
||||
{
|
||||
return((str-10)/3);
|
||||
}
|
||||
|
|
@ -1194,8 +1196,8 @@ register short str;
|
|||
* compute additional damage done for exceptionally high or low strength
|
||||
*/
|
||||
|
||||
add_dam(str)
|
||||
register short str;
|
||||
int
|
||||
add_dam(short str)
|
||||
{
|
||||
return((str-9)/2);
|
||||
}
|
||||
|
|
@ -1204,7 +1206,8 @@ register short str;
|
|||
* hung_dam:
|
||||
* Calculate damage depending on players hungry state
|
||||
*/
|
||||
hung_dam()
|
||||
int
|
||||
hung_dam(void)
|
||||
{
|
||||
reg int howmuch = 0;
|
||||
|
||||
|
|
@ -1222,11 +1225,10 @@ hung_dam()
|
|||
* A missile hits a monster
|
||||
*/
|
||||
|
||||
thunk(weap, tp, mname)
|
||||
register struct object *weap;
|
||||
register struct thing *tp; /* Defender */
|
||||
register char *mname;
|
||||
void
|
||||
thunk(struct object *weap, struct thing *tp, char *mname)
|
||||
{
|
||||
/* tp: Defender */
|
||||
char *def_name; /* Name of defender */
|
||||
|
||||
/* What do we call the defender? */
|
||||
|
|
@ -1251,10 +1253,8 @@ register char *mname;
|
|||
* A missile from a monster hits the player
|
||||
*/
|
||||
|
||||
m_thunk(weap, tp, mname)
|
||||
register struct object *weap;
|
||||
register struct thing *tp;
|
||||
register char *mname;
|
||||
void
|
||||
m_thunk(struct object *weap, struct thing *tp, char *mname)
|
||||
{
|
||||
char *att_name; /* Name of attacker */
|
||||
|
||||
|
|
@ -1280,11 +1280,10 @@ register char *mname;
|
|||
* A missile misses a monster
|
||||
*/
|
||||
|
||||
bounce(weap, tp, mname)
|
||||
register struct object *weap;
|
||||
register struct thing *tp; /* Defender */
|
||||
register char *mname;
|
||||
void
|
||||
bounce(struct object *weap, struct thing *tp, char *mname)
|
||||
{
|
||||
/* tp: Defender */
|
||||
char *def_name; /* Name of defender */
|
||||
|
||||
/* What do we call the defender? */
|
||||
|
|
@ -1309,10 +1308,8 @@ register char *mname;
|
|||
A missle from a monster misses the player
|
||||
*/
|
||||
|
||||
m_bounce(weap, tp, mname)
|
||||
register struct object *weap;
|
||||
register struct thing *tp;
|
||||
register char *mname;
|
||||
void
|
||||
m_bounce(struct object *weap, struct thing *tp, char *mname)
|
||||
{
|
||||
char *att_name; /* Name of attacker */
|
||||
|
||||
|
|
@ -1339,8 +1336,8 @@ register char *mname;
|
|||
* Returns true if an object radiates magic
|
||||
*/
|
||||
|
||||
is_magic(obj)
|
||||
register struct object *obj;
|
||||
bool
|
||||
is_magic(struct object *obj)
|
||||
{
|
||||
switch (obj->o_type)
|
||||
{
|
||||
|
|
@ -1364,9 +1361,8 @@ register struct object *obj;
|
|||
* Called to put a monster to death
|
||||
*/
|
||||
|
||||
killed(item, pr, points)
|
||||
register struct linked_list *item;
|
||||
bool pr, points;
|
||||
void
|
||||
killed(struct linked_list *item, bool pr, bool points)
|
||||
{
|
||||
register struct thing *tp;
|
||||
register struct linked_list *pitem, *nexti;
|
||||
|
|
@ -1447,9 +1443,7 @@ bool pr, points;
|
|||
*/
|
||||
|
||||
struct object *
|
||||
wield_weap(thrown, mp)
|
||||
struct object *thrown;
|
||||
struct thing *mp;
|
||||
wield_weap(struct object *thrown, struct thing *mp)
|
||||
{
|
||||
int look_for = 0, /* The projectile weapon we are looking for */
|
||||
new_rate, /* The rating of a prospective weapon */
|
||||
|
|
@ -1529,8 +1523,8 @@ struct thing *mp;
|
|||
return(candidate);
|
||||
}
|
||||
|
||||
explode(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
explode(struct thing *tp)
|
||||
{
|
||||
|
||||
register int x,y, damage;
|
||||
|
|
|
|||
|
|
@ -97,10 +97,8 @@ char *metal[NMETAL] = {
|
|||
* make sure all the percentages specified in the tables add up to the
|
||||
* right amounts
|
||||
*/
|
||||
badcheck(name, magic, bound)
|
||||
char *name;
|
||||
register struct magic_item *magic;
|
||||
register int bound;
|
||||
void
|
||||
badcheck(char *name, struct magic_item *magic, int bound)
|
||||
{
|
||||
register struct magic_item *end;
|
||||
|
||||
|
|
@ -120,7 +118,8 @@ register int bound;
|
|||
* Initialize the potion color scheme for this time
|
||||
*/
|
||||
|
||||
init_colors()
|
||||
void
|
||||
init_colors(void)
|
||||
{
|
||||
register int i, j;
|
||||
bool used[NCOLORS];
|
||||
|
|
@ -148,7 +147,8 @@ init_colors()
|
|||
* Initialize the construction materials for wands and staffs
|
||||
*/
|
||||
|
||||
init_materials()
|
||||
void
|
||||
init_materials(void)
|
||||
{
|
||||
register int i, j;
|
||||
register char *str;
|
||||
|
|
@ -201,7 +201,8 @@ init_materials()
|
|||
* do any initialization for miscellaneous magic
|
||||
*/
|
||||
|
||||
init_misc()
|
||||
void
|
||||
init_misc(void)
|
||||
{
|
||||
register int i;
|
||||
|
||||
|
|
@ -221,7 +222,8 @@ init_misc()
|
|||
* Generate the names of the various scrolls
|
||||
*/
|
||||
|
||||
init_names()
|
||||
void
|
||||
init_names(void)
|
||||
{
|
||||
register int nsyl;
|
||||
register char *cp, *sp;
|
||||
|
|
@ -258,7 +260,8 @@ init_names()
|
|||
* roll up the rogue
|
||||
*/
|
||||
|
||||
init_player()
|
||||
void
|
||||
init_player(void)
|
||||
{
|
||||
int stat_total, ch = 0, wpt = 0, i, j;
|
||||
struct linked_list *weap_item, *armor_item, *food_item;
|
||||
|
|
@ -459,7 +462,8 @@ init_player()
|
|||
* Initialize the ring stone setting scheme for this time
|
||||
*/
|
||||
|
||||
init_stones()
|
||||
void
|
||||
init_stones(void)
|
||||
{
|
||||
register int i, j;
|
||||
bool used[NSTONES];
|
||||
|
|
@ -487,7 +491,8 @@ init_stones()
|
|||
* init_things
|
||||
* Initialize the probabilities for types of things
|
||||
*/
|
||||
init_things()
|
||||
void
|
||||
init_things(void)
|
||||
{
|
||||
register struct magic_item *mp;
|
||||
|
||||
|
|
|
|||
61
arogue5/io.c
61
arogue5/io.c
|
|
@ -18,6 +18,9 @@
|
|||
#include <stdarg.h>
|
||||
#include "rogue.h"
|
||||
|
||||
void doadd(char *fmt, va_list ap);
|
||||
void ministat(void);
|
||||
|
||||
/*
|
||||
* msg:
|
||||
* Display a message at the top of the screen.
|
||||
|
|
@ -27,6 +30,7 @@ static char msgbuf[BUFSIZ];
|
|||
static int newpos = 0;
|
||||
|
||||
/*VARARGS1*/
|
||||
void
|
||||
msg(char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
|
@ -54,6 +58,7 @@ msg(char *fmt, ...)
|
|||
/*
|
||||
* add things to the current message
|
||||
*/
|
||||
void
|
||||
addmsg(char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
|
@ -66,7 +71,8 @@ addmsg(char *fmt, ...)
|
|||
* Display a new msg (giving him a chance to see the previous one if it
|
||||
* is up there with the --More--)
|
||||
*/
|
||||
endmsg()
|
||||
void
|
||||
endmsg(void)
|
||||
{
|
||||
strncpy(huh, msgbuf, sizeof(huh));
|
||||
|
||||
|
|
@ -96,6 +102,7 @@ endmsg()
|
|||
draw(msgw);
|
||||
}
|
||||
|
||||
void
|
||||
doadd(char *fmt, va_list ap)
|
||||
{
|
||||
/*
|
||||
|
|
@ -113,9 +120,8 @@ doadd(char *fmt, va_list ap)
|
|||
* flgptr will be NULL if we don't know what the monster is yet!
|
||||
*/
|
||||
|
||||
step_ok(y, x, can_on_monst, flgptr)
|
||||
register int y, x, can_on_monst;
|
||||
register struct thing *flgptr;
|
||||
bool
|
||||
step_ok(int y, int x, int can_on_monst, struct thing *flgptr)
|
||||
{
|
||||
/* can_on_monst = MONSTOK if all we care about are physical obstacles */
|
||||
register struct linked_list *item;
|
||||
|
|
@ -156,7 +162,8 @@ register struct thing *flgptr;
|
|||
* returns true if it is ok for type to shoot over ch
|
||||
*/
|
||||
|
||||
shoot_ok(ch)
|
||||
bool
|
||||
shoot_ok(char ch)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
|
|
@ -177,7 +184,8 @@ shoot_ok(ch)
|
|||
* getchar.
|
||||
*/
|
||||
|
||||
readchar()
|
||||
int
|
||||
readchar(void)
|
||||
{
|
||||
int ch;
|
||||
|
||||
|
|
@ -195,10 +203,11 @@ readchar()
|
|||
/*
|
||||
* status:
|
||||
* Display the important stats line. Keep the cursor where it was.
|
||||
* If display is TRUE, display unconditionally
|
||||
*/
|
||||
|
||||
status(display)
|
||||
bool display; /* is TRUE, display unconditionally */
|
||||
void
|
||||
status(bool display)
|
||||
{
|
||||
register struct stats *stat_ptr, *max_ptr;
|
||||
register int oy = 0, ox = 0, temp;
|
||||
|
|
@ -327,7 +336,8 @@ line_two:
|
|||
wmove(cw, oy, ox);
|
||||
}
|
||||
|
||||
ministat()
|
||||
void
|
||||
ministat(void)
|
||||
{
|
||||
register int oy, ox, temp;
|
||||
static char buf[LINELEN];
|
||||
|
|
@ -367,9 +377,8 @@ ministat()
|
|||
* Sit around until the guy types the right key
|
||||
*/
|
||||
|
||||
wait_for(win,ch)
|
||||
WINDOW *win;
|
||||
register char ch;
|
||||
void
|
||||
wait_for(WINDOW *win, char ch)
|
||||
{
|
||||
register char c;
|
||||
|
||||
|
|
@ -386,9 +395,8 @@ register char ch;
|
|||
* function used to display a window and wait before returning
|
||||
*/
|
||||
|
||||
show_win(scr, message)
|
||||
register WINDOW *scr;
|
||||
char *message;
|
||||
void
|
||||
show_win(WINDOW *scr, char *message)
|
||||
{
|
||||
mvwaddstr(scr, 0, 0, message);
|
||||
touchwin(scr);
|
||||
|
|
@ -403,9 +411,8 @@ char *message;
|
|||
* dbotline:
|
||||
* Displays message on bottom line and waits for a space to return
|
||||
*/
|
||||
dbotline(scr,message)
|
||||
WINDOW *scr;
|
||||
char *message;
|
||||
void
|
||||
dbotline(WINDOW *scr, char *message)
|
||||
{
|
||||
mvwaddstr(scr,LINES-1,0,message);
|
||||
draw(scr);
|
||||
|
|
@ -417,8 +424,8 @@ char *message;
|
|||
* restscr:
|
||||
* Restores the screen to the terminal
|
||||
*/
|
||||
restscr(scr)
|
||||
WINDOW *scr;
|
||||
void
|
||||
restscr(WINDOW *scr)
|
||||
{
|
||||
clearok(scr,TRUE);
|
||||
touchwin(scr);
|
||||
|
|
@ -431,10 +438,7 @@ WINDOW *scr;
|
|||
*/
|
||||
|
||||
unsigned long
|
||||
netread(error, size, stream)
|
||||
int *error;
|
||||
int size;
|
||||
FILE *stream;
|
||||
netread(int *error, int size, FILE *stream)
|
||||
{
|
||||
unsigned long result = 0L, /* What we read in */
|
||||
partial; /* Partial value */
|
||||
|
|
@ -469,12 +473,13 @@ FILE *stream;
|
|||
/*
|
||||
* netwrite:
|
||||
* Write out a byte, short, or long machine independently.
|
||||
* value: What to write
|
||||
* size: How much to write out
|
||||
* stream: Where to write it
|
||||
*/
|
||||
|
||||
netwrite(value, size, stream)
|
||||
unsigned long value; /* What to write */
|
||||
int size; /* How much to write out */
|
||||
FILE *stream; /* Where to write it */
|
||||
int
|
||||
netwrite(unsigned long value, int size, FILE *stream)
|
||||
{
|
||||
int i; /* Goes through value one byte at a time */
|
||||
char outc; /* The next character to be written */
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
* Takes an item out of whatever linked list it might be in
|
||||
*/
|
||||
|
||||
_detach(list, item)
|
||||
register struct linked_list **list, *item;
|
||||
void
|
||||
_detach(struct linked_list **list, struct linked_list *item)
|
||||
{
|
||||
if (*list == item)
|
||||
*list = next(item);
|
||||
|
|
@ -37,8 +37,8 @@ register struct linked_list **list, *item;
|
|||
* add an item to the head of a list
|
||||
*/
|
||||
|
||||
_attach(list, item)
|
||||
register struct linked_list **list, *item;
|
||||
void
|
||||
_attach(struct linked_list **list, struct linked_list *item)
|
||||
{
|
||||
if (*list != NULL)
|
||||
{
|
||||
|
|
@ -60,8 +60,8 @@ register struct linked_list **list, *item;
|
|||
* Throw the whole object list away
|
||||
*/
|
||||
|
||||
_o_free_list(ptr)
|
||||
register struct linked_list **ptr;
|
||||
void
|
||||
_o_free_list(struct linked_list **ptr)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
|
||||
|
|
@ -78,8 +78,8 @@ register struct linked_list **ptr;
|
|||
* free up an item and its object(and maybe contents)
|
||||
*/
|
||||
|
||||
o_discard(item)
|
||||
register struct linked_list *item;
|
||||
void
|
||||
o_discard(struct linked_list *item)
|
||||
{
|
||||
register struct object *obj;
|
||||
obj = OBJPTR(item);
|
||||
|
|
@ -95,8 +95,8 @@ register struct linked_list *item;
|
|||
* Throw the whole thing list away
|
||||
*/
|
||||
|
||||
_t_free_list(ptr)
|
||||
register struct linked_list **ptr;
|
||||
void
|
||||
_t_free_list(struct linked_list **ptr)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
|
||||
|
|
@ -113,8 +113,8 @@ register struct linked_list **ptr;
|
|||
* free up an item and its thing
|
||||
*/
|
||||
|
||||
t_discard(item)
|
||||
struct linked_list *item;
|
||||
void
|
||||
t_discard(struct linked_list *item)
|
||||
{
|
||||
total -= 2;
|
||||
FREE(item->l_data);
|
||||
|
|
@ -126,8 +126,8 @@ struct linked_list *item;
|
|||
* get rid of an item structure -- don't worry about contents
|
||||
*/
|
||||
|
||||
destroy_item(item)
|
||||
register struct linked_list *item;
|
||||
void
|
||||
destroy_item(struct linked_list *item)
|
||||
{
|
||||
total--;
|
||||
FREE(item);
|
||||
|
|
@ -139,8 +139,7 @@ register struct linked_list *item;
|
|||
*/
|
||||
|
||||
struct linked_list *
|
||||
new_item(size)
|
||||
int size;
|
||||
new_item(int size)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
|
||||
|
|
@ -158,7 +157,7 @@ int size;
|
|||
*/
|
||||
|
||||
struct linked_list *
|
||||
creat_item()
|
||||
creat_item(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
|
||||
|
|
@ -169,8 +168,7 @@ creat_item()
|
|||
}
|
||||
|
||||
char *
|
||||
new(size)
|
||||
int size;
|
||||
new(int size)
|
||||
{
|
||||
register char *space = ALLOC(size);
|
||||
static char errbuf[LINELEN];
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ static char *funfruit[] = {
|
|||
#define NFRUIT (sizeof(funfruit) / sizeof (char *))
|
||||
|
||||
void open_records(void);
|
||||
bool holiday(void);
|
||||
|
||||
main(argc, argv, envp)
|
||||
char **argv;
|
||||
char **envp;
|
||||
int
|
||||
main(int argc, char *argv[], char *envp[])
|
||||
{
|
||||
register char *env;
|
||||
int lowtime;
|
||||
|
|
@ -123,7 +123,6 @@ char **envp;
|
|||
* Check for a network update
|
||||
*/
|
||||
if (argc == 2 && strcmp(argv[1], "-u") == 0) {
|
||||
unsigned long netread();
|
||||
int errcheck, errors = 0;
|
||||
unsigned long amount;
|
||||
short monster;
|
||||
|
|
@ -277,8 +276,8 @@ endit(int sig)
|
|||
* Exit the program, printing a message.
|
||||
*/
|
||||
|
||||
fatal(s)
|
||||
char *s;
|
||||
void
|
||||
fatal(char *s)
|
||||
{
|
||||
clear();
|
||||
move(LINES-2, 0);
|
||||
|
|
@ -294,8 +293,8 @@ char *s;
|
|||
* Pick a very random number.
|
||||
*/
|
||||
|
||||
rnd(range)
|
||||
register int range;
|
||||
int
|
||||
rnd(int range)
|
||||
{
|
||||
return(range == 0 ? 0 : md_rand() % range);
|
||||
}
|
||||
|
|
@ -305,8 +304,8 @@ register int range;
|
|||
* roll a number of dice
|
||||
*/
|
||||
|
||||
roll(number, sides)
|
||||
register int number, sides;
|
||||
int
|
||||
roll(int number, int sides)
|
||||
{
|
||||
register int dtotal = 0;
|
||||
|
||||
|
|
@ -336,10 +335,11 @@ tstp(int a)
|
|||
}
|
||||
# endif
|
||||
|
||||
setup()
|
||||
void
|
||||
setup(void)
|
||||
{
|
||||
#ifdef CHECKTIME
|
||||
int checkout();
|
||||
void checkout();
|
||||
#endif
|
||||
|
||||
#ifndef DUMP
|
||||
|
|
@ -392,7 +392,8 @@ setup()
|
|||
* refreshing things and looking at the proper times.
|
||||
*/
|
||||
|
||||
playit()
|
||||
void
|
||||
playit(void)
|
||||
{
|
||||
register char *opts;
|
||||
|
||||
|
|
@ -416,7 +417,8 @@ playit()
|
|||
/*
|
||||
* see if the system is being used too much for this game
|
||||
*/
|
||||
too_much()
|
||||
bool
|
||||
too_much(void)
|
||||
{
|
||||
#ifdef MAXLOAD
|
||||
double avec[3];
|
||||
|
|
@ -435,7 +437,8 @@ too_much()
|
|||
* author:
|
||||
* See if a user is an author of the program
|
||||
*/
|
||||
author()
|
||||
bool
|
||||
author(void)
|
||||
{
|
||||
switch (md_getuid()) {
|
||||
#if AUTHOR
|
||||
|
|
@ -450,7 +453,24 @@ author()
|
|||
|
||||
|
||||
#ifdef CHECKTIME
|
||||
checkout()
|
||||
/*
|
||||
* checkout()'s version of msg. If we are in the middle of a shell, do a
|
||||
* printf instead of a msg to avoid the refresh.
|
||||
*/
|
||||
void
|
||||
chmsg(char *fmt, int arg)
|
||||
{
|
||||
if (in_shell) {
|
||||
printf(fmt, arg);
|
||||
putchar('\n');
|
||||
fflush(stdout);
|
||||
}
|
||||
else
|
||||
msg(fmt, arg);
|
||||
}
|
||||
|
||||
void
|
||||
checkout(void)
|
||||
{
|
||||
static char *msgs[] = {
|
||||
"The system is too loaded for games. Please leave in %d minutes",
|
||||
|
|
@ -482,23 +502,6 @@ checkout()
|
|||
alarm(CHECKTIME * 60);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* checkout()'s version of msg. If we are in the middle of a shell, do a
|
||||
* printf instead of a msg to avoid the refresh.
|
||||
*/
|
||||
chmsg(fmt, arg)
|
||||
char *fmt;
|
||||
int arg;
|
||||
{
|
||||
if (in_shell) {
|
||||
printf(fmt, arg);
|
||||
putchar('\n');
|
||||
fflush(stdout);
|
||||
}
|
||||
else
|
||||
msg(fmt, arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOADAV
|
||||
|
|
@ -510,8 +513,8 @@ struct nlist avenrun =
|
|||
"_avenrun"
|
||||
};
|
||||
|
||||
loadav(avg)
|
||||
reg double *avg;
|
||||
void
|
||||
loadav(double *avg)
|
||||
{
|
||||
reg int kmem;
|
||||
|
||||
|
|
@ -536,7 +539,8 @@ bad:
|
|||
#include <sys/types.h>
|
||||
#include <utmp.h>
|
||||
struct utmp buf;
|
||||
ucount()
|
||||
int
|
||||
ucount(void)
|
||||
{
|
||||
reg struct utmp *up;
|
||||
reg FILE *utmp;
|
||||
|
|
@ -559,7 +563,8 @@ ucount()
|
|||
* holiday:
|
||||
* Returns TRUE when it is a good time to play rogue
|
||||
*/
|
||||
holiday()
|
||||
bool
|
||||
holiday(void)
|
||||
{
|
||||
time_t now;
|
||||
struct tm *localtime();
|
||||
|
|
|
|||
|
|
@ -30,15 +30,20 @@ static char *frontier,
|
|||
*bits;
|
||||
static int maze_lines,
|
||||
maze_cols;
|
||||
char *moffset(),
|
||||
*foffset();
|
||||
|
||||
void draw_maze(void);
|
||||
int findcells(int y, int x);
|
||||
char *foffset(int y, int x);
|
||||
char *moffset(int y, int x);
|
||||
void rmwall(int newy, int newx, int oldy, int oldx);
|
||||
|
||||
|
||||
/*
|
||||
* crankout:
|
||||
* Does actual drawing of maze to window
|
||||
*/
|
||||
crankout()
|
||||
void
|
||||
crankout(void)
|
||||
{
|
||||
reg int x, y;
|
||||
|
||||
|
|
@ -71,7 +76,8 @@ crankout()
|
|||
* domaze:
|
||||
* Draw the maze on this level.
|
||||
*/
|
||||
do_maze()
|
||||
void
|
||||
do_maze(void)
|
||||
{
|
||||
reg int least;
|
||||
reg struct room *rp;
|
||||
|
|
@ -95,7 +101,7 @@ do_maze()
|
|||
/*
|
||||
* add some gold to make it worth looking for
|
||||
*/
|
||||
item = spec_item(GOLD, NULL, NULL, NULL);
|
||||
item = spec_item(GOLD, 0, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_count *= (rnd(10) + 1); /* add in one large hunk */
|
||||
attach(lvl_obj, item);
|
||||
|
|
@ -108,7 +114,7 @@ do_maze()
|
|||
/*
|
||||
* add in some food to make sure he has enough
|
||||
*/
|
||||
item = spec_item(FOOD, NULL, NULL, NULL);
|
||||
item = spec_item(FOOD, 0, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
attach(lvl_obj, item);
|
||||
do {
|
||||
|
|
@ -133,7 +139,8 @@ do_maze()
|
|||
* draw_maze:
|
||||
* Generate and draw the maze on the screen
|
||||
*/
|
||||
draw_maze()
|
||||
void
|
||||
draw_maze(void)
|
||||
{
|
||||
reg int i, j, more;
|
||||
reg char *ptr;
|
||||
|
|
@ -169,8 +176,8 @@ draw_maze()
|
|||
* findcells:
|
||||
* Figure out cells to open up
|
||||
*/
|
||||
findcells(y,x)
|
||||
reg int x, y;
|
||||
int
|
||||
findcells(int y, int x)
|
||||
{
|
||||
reg int rtpos, i;
|
||||
|
||||
|
|
@ -221,8 +228,7 @@ reg int x, y;
|
|||
* Calculate memory address for frontier
|
||||
*/
|
||||
char *
|
||||
foffset(y, x)
|
||||
int y, x;
|
||||
foffset(int y, int x)
|
||||
{
|
||||
|
||||
return (frontier + (y * maze_cols) + x);
|
||||
|
|
@ -236,8 +242,7 @@ int y, x;
|
|||
*/
|
||||
|
||||
bool
|
||||
maze_view(y, x)
|
||||
int y, x;
|
||||
maze_view(int y, int x)
|
||||
{
|
||||
register int start, goal, delta, ycheck = 0, xcheck = 0, absy, absx, see_radius;
|
||||
register bool row;
|
||||
|
|
@ -342,8 +347,7 @@ int y, x;
|
|||
* Calculate memory address for bits
|
||||
*/
|
||||
char *
|
||||
moffset(y, x)
|
||||
int y, x;
|
||||
moffset(int y, int x)
|
||||
{
|
||||
|
||||
return (bits + (y * (COLS - 1)) + x);
|
||||
|
|
@ -356,8 +360,8 @@ int y, x;
|
|||
* rmwall:
|
||||
* Removes appropriate walls from the maze
|
||||
*/
|
||||
rmwall(newy, newx, oldy, oldx)
|
||||
int newy, newx, oldy, oldx;
|
||||
void
|
||||
rmwall(int newy, int newx, int oldy, int oldx)
|
||||
{
|
||||
reg int xdif,ydif;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#define PATH_MAX MAX_PATH
|
||||
|
|
@ -81,7 +82,7 @@
|
|||
#define MOD_MOVE(c) (toupper(c) )
|
||||
|
||||
void
|
||||
md_init()
|
||||
md_init(void)
|
||||
{
|
||||
#ifdef __INTERIX
|
||||
char *term;
|
||||
|
|
@ -132,7 +133,7 @@ md_putchar(int c)
|
|||
static int md_standout_mode = 0;
|
||||
|
||||
int
|
||||
md_raw_standout()
|
||||
md_raw_standout(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
|
||||
|
|
@ -155,7 +156,7 @@ md_raw_standout()
|
|||
}
|
||||
|
||||
int
|
||||
md_raw_standend()
|
||||
md_raw_standend(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
|
||||
|
|
@ -223,7 +224,7 @@ md_fdopen(int fd, char *mode)
|
|||
}
|
||||
|
||||
int
|
||||
md_normaluser()
|
||||
md_normaluser(void)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
setuid(getuid());
|
||||
|
|
@ -232,7 +233,7 @@ md_normaluser()
|
|||
}
|
||||
|
||||
int
|
||||
md_getuid()
|
||||
md_getuid(void)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
return( getuid() );
|
||||
|
|
@ -242,7 +243,7 @@ md_getuid()
|
|||
}
|
||||
|
||||
char *
|
||||
md_getusername()
|
||||
md_getusername(void)
|
||||
{
|
||||
static char login[80];
|
||||
char *l = NULL;
|
||||
|
|
@ -279,7 +280,7 @@ md_getusername()
|
|||
}
|
||||
|
||||
char *
|
||||
md_gethomedir()
|
||||
md_gethomedir(void)
|
||||
{
|
||||
static char homedir[PATH_MAX];
|
||||
char *h = NULL;
|
||||
|
|
@ -335,7 +336,7 @@ md_gethomedir()
|
|||
}
|
||||
|
||||
char *
|
||||
md_getshell()
|
||||
md_getshell(void)
|
||||
{
|
||||
static char shell[PATH_MAX];
|
||||
char *s = NULL;
|
||||
|
|
@ -365,7 +366,7 @@ md_getshell()
|
|||
}
|
||||
|
||||
int
|
||||
md_shellescape()
|
||||
md_shellescape(void)
|
||||
{
|
||||
#if (!defined(_WIN32) && !defined(__DJGPP__))
|
||||
int ret_status;
|
||||
|
|
@ -427,7 +428,7 @@ directory_exists(char *dirname)
|
|||
}
|
||||
|
||||
char *
|
||||
md_getroguedir()
|
||||
md_getroguedir(void)
|
||||
{
|
||||
static char path[1024];
|
||||
char *end,*home;
|
||||
|
|
@ -491,8 +492,7 @@ md_crypt(char *key, char *salt)
|
|||
}
|
||||
|
||||
char *
|
||||
md_getpass(prompt)
|
||||
char *prompt;
|
||||
md_getpass(char *prompt)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
static char password_buffer[9];
|
||||
|
|
@ -587,7 +587,7 @@ md_htonl(unsigned long int x)
|
|||
}
|
||||
|
||||
int
|
||||
md_rand()
|
||||
md_rand(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return(rand());
|
||||
|
|
@ -597,8 +597,7 @@ md_rand()
|
|||
}
|
||||
|
||||
int
|
||||
md_srand(seed)
|
||||
register int seed;
|
||||
md_srand(int seed)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
srand(seed);
|
||||
|
|
@ -608,7 +607,7 @@ register int seed;
|
|||
}
|
||||
|
||||
long
|
||||
md_memused()
|
||||
md_memused(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
MEMORYSTATUS stat;
|
||||
|
|
@ -622,7 +621,7 @@ md_memused()
|
|||
}
|
||||
|
||||
char *
|
||||
md_gethostname()
|
||||
md_gethostname(void)
|
||||
{
|
||||
static char nodename[80];
|
||||
char *n = NULL;
|
||||
|
|
@ -644,7 +643,7 @@ md_gethostname()
|
|||
}
|
||||
|
||||
int
|
||||
md_erasechar()
|
||||
md_erasechar(void)
|
||||
{
|
||||
#ifdef BSD
|
||||
return(_tty.sg_erase); /* process erase character */
|
||||
|
|
@ -656,7 +655,7 @@ md_erasechar()
|
|||
}
|
||||
|
||||
int
|
||||
md_killchar()
|
||||
md_killchar(void)
|
||||
{
|
||||
#ifdef BSD
|
||||
return(_tty.sg_kill);
|
||||
|
|
@ -673,8 +672,7 @@ md_killchar()
|
|||
*/
|
||||
|
||||
char *
|
||||
md_unctrl(ch)
|
||||
char ch;
|
||||
md_unctrl(char ch)
|
||||
{
|
||||
#if USG5_0
|
||||
extern char *_unctrl[]; /* Defined in curses library */
|
||||
|
|
@ -686,7 +684,7 @@ char ch;
|
|||
}
|
||||
|
||||
void
|
||||
md_flushinp()
|
||||
md_flushinp(void)
|
||||
{
|
||||
#ifdef BSD
|
||||
ioctl(0, TIOCFLUSH);
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@
|
|||
* See if a monster has some magic it can use. Use it and return TRUE if so.
|
||||
*/
|
||||
bool
|
||||
m_use_item(monster, monst_pos, defend_pos)
|
||||
register struct thing *monster;
|
||||
register coord *monst_pos, *defend_pos;
|
||||
m_use_item(struct thing *monster, coord *monst_pos, coord *defend_pos)
|
||||
{
|
||||
register struct linked_list *pitem;
|
||||
register struct object *obj;
|
||||
|
|
@ -95,10 +93,11 @@ register coord *monst_pos, *defend_pos;
|
|||
|
||||
/*
|
||||
* add something to the contents of something else
|
||||
* bag: the holder of the items
|
||||
* item: the item to put inside
|
||||
*/
|
||||
put_contents(bag, item)
|
||||
register struct object *bag; /* the holder of the items */
|
||||
register struct linked_list *item; /* the item to put inside */
|
||||
void
|
||||
put_contents(struct object *bag, struct linked_list *item)
|
||||
{
|
||||
register struct linked_list *titem;
|
||||
register struct object *tobj;
|
||||
|
|
@ -123,10 +122,10 @@ register struct linked_list *item; /* the item to put inside */
|
|||
|
||||
/*
|
||||
* remove something from something else
|
||||
* bag: the holder of the items
|
||||
*/
|
||||
take_contents(bag, item)
|
||||
register struct object *bag; /* the holder of the items */
|
||||
register struct linked_list *item;
|
||||
void
|
||||
take_contents(struct object *bag, struct linked_list *item)
|
||||
{
|
||||
|
||||
if (bag->o_ac <= 0) {
|
||||
|
|
@ -140,8 +139,8 @@ register struct linked_list *item;
|
|||
}
|
||||
|
||||
|
||||
do_bag(item)
|
||||
register struct linked_list *item;
|
||||
void
|
||||
do_bag(struct linked_list *item)
|
||||
{
|
||||
|
||||
register struct linked_list *titem = NULL;
|
||||
|
|
@ -233,7 +232,8 @@ register struct linked_list *item;
|
|||
}
|
||||
}
|
||||
|
||||
do_panic()
|
||||
void
|
||||
do_panic(void)
|
||||
{
|
||||
register int x,y;
|
||||
register struct linked_list *mon;
|
||||
|
|
@ -272,8 +272,7 @@ do_panic()
|
|||
* print miscellaneous magic bonuses
|
||||
*/
|
||||
char *
|
||||
misc_name(obj)
|
||||
register struct object *obj;
|
||||
misc_name(struct object *obj)
|
||||
{
|
||||
static char buf[LINELEN];
|
||||
char buf1[LINELEN];
|
||||
|
|
@ -340,7 +339,8 @@ register struct object *obj;
|
|||
return buf;
|
||||
}
|
||||
|
||||
use_emori()
|
||||
void
|
||||
use_emori(void)
|
||||
{
|
||||
char selection; /* Cloak function */
|
||||
int state = 0; /* Menu state */
|
||||
|
|
@ -442,8 +442,8 @@ use_emori()
|
|||
}
|
||||
}
|
||||
|
||||
use_mm(which)
|
||||
int which;
|
||||
void
|
||||
use_mm(int which)
|
||||
{
|
||||
register struct object *obj = NULL;
|
||||
register struct linked_list *item = NULL;
|
||||
|
|
@ -496,7 +496,7 @@ int which;
|
|||
msg("The jug is empty");
|
||||
break;
|
||||
}
|
||||
quaff (obj->o_ac, NULL, FALSE);
|
||||
quaff (obj->o_ac, 0, FALSE);
|
||||
obj->o_ac = JUG_EMPTY;
|
||||
fuse (alchemy, obj, ALCHEMYTIME, AFTER);
|
||||
if (!(obj->o_flags & ISKNOW))
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include "curses.h"
|
||||
#include "rogue.h"
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -21,8 +22,8 @@
|
|||
/*
|
||||
* Check_residue takes care of any effect of the monster
|
||||
*/
|
||||
check_residue(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
check_residue(struct thing *tp)
|
||||
{
|
||||
/*
|
||||
* Take care of special abilities
|
||||
|
|
@ -63,13 +64,11 @@ register struct thing *tp;
|
|||
|
||||
/*
|
||||
* Creat_mons creates the specified monster -- any if 0
|
||||
* person: Where to create next to
|
||||
*/
|
||||
|
||||
bool
|
||||
creat_mons(person, monster, report)
|
||||
struct thing *person; /* Where to create next to */
|
||||
short monster;
|
||||
bool report;
|
||||
creat_mons(struct thing *person, short monster, bool report)
|
||||
{
|
||||
struct linked_list *nitem;
|
||||
register struct thing *tp;
|
||||
|
|
@ -121,9 +120,7 @@ bool report;
|
|||
*/
|
||||
|
||||
void
|
||||
genmonsters(least, treas)
|
||||
register int least;
|
||||
bool treas;
|
||||
genmonsters(int least, bool treas)
|
||||
{
|
||||
reg int i;
|
||||
reg struct room *rp = &rooms[0];
|
||||
|
|
@ -166,8 +163,7 @@ bool treas;
|
|||
*/
|
||||
|
||||
short
|
||||
id_monst(monster)
|
||||
register char monster;
|
||||
id_monst(char monster)
|
||||
{
|
||||
register short result;
|
||||
|
||||
|
|
@ -187,11 +183,8 @@ register char monster;
|
|||
* Pick a new monster and add it to the list
|
||||
*/
|
||||
|
||||
new_monster(item, type, cp, max_monster)
|
||||
struct linked_list *item;
|
||||
short type;
|
||||
register coord *cp;
|
||||
bool max_monster;
|
||||
void
|
||||
new_monster(struct linked_list *item, short type, coord *cp, bool max_monster)
|
||||
{
|
||||
register struct thing *tp;
|
||||
register struct monster *mp;
|
||||
|
|
@ -379,8 +372,7 @@ bool max_monster;
|
|||
*/
|
||||
|
||||
short
|
||||
randmonster(wander, no_unique)
|
||||
register bool wander, no_unique;
|
||||
randmonster(bool wander, bool no_unique)
|
||||
{
|
||||
register int d, cur_level, range, i;
|
||||
|
||||
|
|
@ -418,8 +410,8 @@ register bool wander, no_unique;
|
|||
* to purchase something.
|
||||
*/
|
||||
|
||||
sell(tp)
|
||||
register struct thing *tp;
|
||||
void
|
||||
sell(struct thing *tp)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct object *obj;
|
||||
|
|
@ -731,8 +723,7 @@ register struct thing *tp;
|
|||
* what to do when the hero steps next to a monster
|
||||
*/
|
||||
struct linked_list *
|
||||
wake_monster(y, x)
|
||||
int y, x;
|
||||
wake_monster(int y, int x)
|
||||
{
|
||||
register struct thing *tp;
|
||||
register struct linked_list *it;
|
||||
|
|
@ -957,7 +948,8 @@ int y, x;
|
|||
* A wandering monster has awakened and is headed for the player
|
||||
*/
|
||||
|
||||
wanderer()
|
||||
void
|
||||
wanderer(void)
|
||||
{
|
||||
register int i;
|
||||
register struct room *hr = roomin(&hero);
|
||||
|
|
|
|||
|
|
@ -37,9 +37,8 @@ static const char Moves[3][3] = {
|
|||
* The guy stepped on a trap.... Make him pay.
|
||||
*/
|
||||
|
||||
be_trapped(th, tc)
|
||||
register struct thing *th;
|
||||
register coord *tc;
|
||||
char
|
||||
be_trapped(struct thing *th, coord *tc)
|
||||
{
|
||||
register struct trap *tp;
|
||||
register char ch;
|
||||
|
|
@ -353,8 +352,7 @@ register coord *tc;
|
|||
*/
|
||||
|
||||
bool
|
||||
blue_light(blessed, cursed)
|
||||
bool blessed, cursed;
|
||||
blue_light(bool blessed, bool cursed)
|
||||
{
|
||||
register struct room *rp;
|
||||
bool ret_val=FALSE; /* Whether or not affect is known */
|
||||
|
|
@ -413,8 +411,8 @@ bool blessed, cursed;
|
|||
* If not, if player came from a legal place, then try to turn him.
|
||||
*/
|
||||
|
||||
corr_move(dy, dx)
|
||||
int dy, dx;
|
||||
void
|
||||
corr_move(int dy, int dx)
|
||||
{
|
||||
int legal=0; /* Number of legal alternatives */
|
||||
register int y, x, /* Indexes though possible positions */
|
||||
|
|
@ -491,7 +489,8 @@ int dy, dx;
|
|||
* dip_it:
|
||||
* Dip an object into a magic pool
|
||||
*/
|
||||
dip_it()
|
||||
void
|
||||
dip_it(void)
|
||||
{
|
||||
reg struct linked_list *what;
|
||||
reg struct object *ob;
|
||||
|
|
@ -667,8 +666,8 @@ dip_it()
|
|||
* consequences (fighting, picking up, etc.)
|
||||
*/
|
||||
|
||||
do_move(dy, dx)
|
||||
int dy, dx;
|
||||
void
|
||||
do_move(int dy, int dx)
|
||||
{
|
||||
register struct room *rp, *orp;
|
||||
register char ch;
|
||||
|
|
@ -878,8 +877,8 @@ int dy, dx;
|
|||
* Start the hero running
|
||||
*/
|
||||
|
||||
do_run(ch)
|
||||
char ch;
|
||||
void
|
||||
do_run(char ch)
|
||||
{
|
||||
firstmove = TRUE;
|
||||
running = TRUE;
|
||||
|
|
@ -894,11 +893,9 @@ char ch;
|
|||
* Returns TRUE if it could find it, FALSE otherwise.
|
||||
*/
|
||||
bool
|
||||
getdelta(match, dy, dx)
|
||||
char match;
|
||||
int *dy, *dx;
|
||||
getdelta(char match, int *dy, int *dx)
|
||||
{
|
||||
register y, x;
|
||||
int y, x;
|
||||
|
||||
for (y = 0; y < 3; y++)
|
||||
for (x = 0; x < 3; x++)
|
||||
|
|
@ -915,8 +912,8 @@ int *dy, *dx;
|
|||
* isatrap:
|
||||
* Returns TRUE if this character is some kind of trap
|
||||
*/
|
||||
isatrap(ch)
|
||||
reg char ch;
|
||||
bool
|
||||
isatrap(char ch)
|
||||
{
|
||||
switch(ch) {
|
||||
case DARTTRAP:
|
||||
|
|
@ -936,8 +933,8 @@ reg char ch;
|
|||
* If it is dark, remove anything that might move.
|
||||
*/
|
||||
|
||||
light(cp)
|
||||
coord *cp;
|
||||
void
|
||||
light(coord *cp)
|
||||
{
|
||||
register struct room *rp;
|
||||
register int j, k, x, y;
|
||||
|
|
@ -1113,8 +1110,7 @@ coord *cp;
|
|||
*/
|
||||
|
||||
bool
|
||||
lit_room(rp)
|
||||
register struct room *rp;
|
||||
lit_room(struct room *rp)
|
||||
{
|
||||
register struct linked_list *fire_item;
|
||||
register struct thing *fire_creature;
|
||||
|
|
@ -1150,8 +1146,7 @@ register struct room *rp;
|
|||
*/
|
||||
|
||||
coord *
|
||||
rndmove(who)
|
||||
struct thing *who;
|
||||
rndmove(struct thing *who)
|
||||
{
|
||||
register int x, y;
|
||||
register int ex, ey, nopen = 0;
|
||||
|
|
@ -1192,9 +1187,8 @@ struct thing *who;
|
|||
* set a trap at (y, x) on screen.
|
||||
*/
|
||||
|
||||
set_trap(tp, y, x)
|
||||
register struct thing *tp;
|
||||
register int y, x;
|
||||
void
|
||||
set_trap(struct thing *tp, int y, int x)
|
||||
{
|
||||
register bool is_player = (tp == &player);
|
||||
register char selection = rnd(7) + '1';
|
||||
|
|
@ -1330,8 +1324,8 @@ register int y, x;
|
|||
* returns what a certain thing will display as to the un-initiated
|
||||
*/
|
||||
|
||||
show(y, x)
|
||||
register int y, x;
|
||||
char
|
||||
show(int y, int x)
|
||||
{
|
||||
register char ch = CCHAR( winat(y, x) );
|
||||
register struct linked_list *it;
|
||||
|
|
@ -1371,8 +1365,7 @@ register int y, x;
|
|||
*/
|
||||
|
||||
struct trap *
|
||||
trap_at(y, x)
|
||||
register int y, x;
|
||||
trap_at(int y, int x)
|
||||
{
|
||||
register struct trap *tp, *ep;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,11 @@
|
|||
#include "rogue.h"
|
||||
#define TERRASAVE 3
|
||||
|
||||
new_level(ltype)
|
||||
LEVTYPE ltype; /* designates type of level to create */
|
||||
void put_things(LEVTYPE ltype);
|
||||
|
||||
/* ltype designates type of level to create */
|
||||
void
|
||||
new_level(LEVTYPE ltype)
|
||||
{
|
||||
register int rm = 0, i, cnt;
|
||||
register char ch;
|
||||
|
|
@ -409,7 +412,8 @@ LEVTYPE ltype; /* designates type of level to create */
|
|||
* Pick a room that is really there
|
||||
*/
|
||||
|
||||
rnd_room()
|
||||
int
|
||||
rnd_room(void)
|
||||
{
|
||||
register int rm;
|
||||
|
||||
|
|
@ -425,10 +429,11 @@ rnd_room()
|
|||
/*
|
||||
* put_things:
|
||||
* put potions and scrolls on this level
|
||||
* ltype: designates type of level to create
|
||||
*/
|
||||
|
||||
put_things(ltype)
|
||||
LEVTYPE ltype; /* designates type of level to create */
|
||||
void
|
||||
put_things(LEVTYPE ltype)
|
||||
{
|
||||
register int i, rm, cnt;
|
||||
register struct object *cur;
|
||||
|
|
@ -448,7 +453,7 @@ LEVTYPE ltype; /* designates type of level to create */
|
|||
* Increasing chance after level 9
|
||||
*/
|
||||
if (ltype != MAZELEV && rnd(HARDER) < level - 8) {
|
||||
register j;
|
||||
register int j;
|
||||
register struct room *rp;
|
||||
|
||||
/* Count the number of free spaces */
|
||||
|
|
|
|||
|
|
@ -35,16 +35,16 @@ struct optstruct {
|
|||
|
||||
typedef struct optstruct OPTION;
|
||||
|
||||
int put_bool(),
|
||||
get_bool(),
|
||||
put_str(),
|
||||
get_str(),
|
||||
get_restr(),
|
||||
get_score(),
|
||||
put_abil(),
|
||||
get_abil(),
|
||||
get_quest(),
|
||||
put_quest();
|
||||
int get_ro(WINDOW *win, int oy, int ox);
|
||||
int get_restr(char *optstr, WINDOW *win);
|
||||
int get_score(char *optstr, WINDOW *win);
|
||||
void put_abil(int *ability, WINDOW *win);
|
||||
void get_abil(int *abil, WINDOW *win);
|
||||
void put_quest(int *quest, WINDOW *win);
|
||||
void get_quest(int *quest, WINDOW *win);
|
||||
void put_bool(bool *b, WINDOW *win);
|
||||
int get_bool(bool *bp, WINDOW *win);
|
||||
void put_str(char *str, WINDOW *win);
|
||||
|
||||
OPTION optlist[] = {
|
||||
{"terse", "Terse output: ",
|
||||
|
|
@ -111,9 +111,8 @@ int get_score(char *optstr, WINDOW *win)
|
|||
/*
|
||||
* The ability field is read-only
|
||||
*/
|
||||
get_abil(abil, win)
|
||||
int *abil;
|
||||
WINDOW *win;
|
||||
void
|
||||
get_abil(int *abil, WINDOW *win)
|
||||
{
|
||||
register int oy, ox;
|
||||
|
||||
|
|
@ -125,9 +124,8 @@ WINDOW *win;
|
|||
/*
|
||||
* The quest field is read-only
|
||||
*/
|
||||
get_quest(quest, win)
|
||||
int *quest;
|
||||
WINDOW *win;
|
||||
void
|
||||
get_quest(int *quest, WINDOW *win)
|
||||
{
|
||||
register int oy, ox;
|
||||
|
||||
|
|
@ -141,9 +139,8 @@ WINDOW *win;
|
|||
* "Get" a read-only value.
|
||||
*/
|
||||
|
||||
get_ro(win, oy, ox)
|
||||
WINDOW *win;
|
||||
register int oy, ox;
|
||||
int
|
||||
get_ro(WINDOW *win, int oy, int ox)
|
||||
{
|
||||
register int ny, nx;
|
||||
register bool op_bad;
|
||||
|
|
@ -180,9 +177,8 @@ register int oy, ox;
|
|||
* allow changing a boolean option and print it out
|
||||
*/
|
||||
|
||||
get_bool(bp, win)
|
||||
bool *bp;
|
||||
WINDOW *win;
|
||||
int
|
||||
get_bool(bool *bp, WINDOW *win)
|
||||
{
|
||||
register int oy, ox;
|
||||
register bool op_bad;
|
||||
|
|
@ -230,9 +226,8 @@ WINDOW *win;
|
|||
/*
|
||||
* set a string option
|
||||
*/
|
||||
get_str(opt, win)
|
||||
register char *opt;
|
||||
WINDOW *win;
|
||||
int
|
||||
get_str(char *opt, WINDOW *win)
|
||||
{
|
||||
register char *sp;
|
||||
register int c, oy, ox;
|
||||
|
|
@ -306,7 +301,8 @@ WINDOW *win;
|
|||
/*
|
||||
* print and then set options from the terminal
|
||||
*/
|
||||
option()
|
||||
void
|
||||
option(void)
|
||||
{
|
||||
register OPTION *op;
|
||||
register int retval;
|
||||
|
|
@ -362,8 +358,8 @@ option()
|
|||
* or the end of the entire option string.
|
||||
*/
|
||||
|
||||
parse_opts(str)
|
||||
register char *str;
|
||||
void
|
||||
parse_opts(char *str)
|
||||
{
|
||||
register char *sp;
|
||||
register OPTION *op;
|
||||
|
|
@ -459,9 +455,8 @@ register char *str;
|
|||
/*
|
||||
* print the character type
|
||||
*/
|
||||
put_abil(ability, win)
|
||||
int *ability;
|
||||
WINDOW *win;
|
||||
void
|
||||
put_abil(int *ability, WINDOW *win)
|
||||
{
|
||||
char *abil;
|
||||
|
||||
|
|
@ -480,9 +475,8 @@ WINDOW *win;
|
|||
* print out the quest
|
||||
*/
|
||||
|
||||
put_quest(quest, win)
|
||||
int *quest;
|
||||
WINDOW *win;
|
||||
void
|
||||
put_quest(int *quest, WINDOW *win)
|
||||
{
|
||||
waddstr(win, rel_magic[*quest].mi_name);
|
||||
}
|
||||
|
|
@ -491,9 +485,8 @@ WINDOW *win;
|
|||
/*
|
||||
* put out a boolean
|
||||
*/
|
||||
put_bool(b, win)
|
||||
bool *b;
|
||||
WINDOW *win;
|
||||
void
|
||||
put_bool(bool *b, WINDOW *win)
|
||||
{
|
||||
waddstr(win, *b ? "True" : "False");
|
||||
}
|
||||
|
|
@ -504,9 +497,8 @@ WINDOW *win;
|
|||
/*
|
||||
* put out a string
|
||||
*/
|
||||
put_str(str, win)
|
||||
char *str;
|
||||
WINDOW *win;
|
||||
void
|
||||
put_str(char *str, WINDOW *win)
|
||||
{
|
||||
waddstr(win, str);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@
|
|||
#include "curses.h"
|
||||
#include "rogue.h"
|
||||
|
||||
extern char rnd_terrain(), get_terrain();
|
||||
char rnd_terrain(void);
|
||||
char get_terrain(char one, char two, char three, char four);
|
||||
|
||||
/*
|
||||
* init_terrain:
|
||||
|
|
@ -19,7 +20,7 @@ extern char rnd_terrain(), get_terrain();
|
|||
*/
|
||||
|
||||
void
|
||||
init_terrain()
|
||||
init_terrain(void)
|
||||
{
|
||||
register struct room *rp;
|
||||
|
||||
|
|
@ -38,11 +39,9 @@ init_terrain()
|
|||
|
||||
|
||||
void
|
||||
do_terrain(basey, basex, deltay, deltax, fresh)
|
||||
int basey, basex, deltay, deltax;
|
||||
bool fresh;
|
||||
do_terrain(int basey, int basex, int deltay, int deltax, bool fresh)
|
||||
{
|
||||
register cury, curx; /* Current y and x positions */
|
||||
int cury, curx; /* Current y and x positions */
|
||||
|
||||
/* Lay out the boundary */
|
||||
for (cury=1; cury<LINES-2; cury++) { /* Vertical "walls" */
|
||||
|
|
@ -125,7 +124,7 @@ bool fresh;
|
|||
*/
|
||||
|
||||
char
|
||||
rnd_terrain()
|
||||
rnd_terrain(void)
|
||||
{
|
||||
int chance = rnd(100);
|
||||
|
||||
|
|
@ -149,8 +148,7 @@ rnd_terrain()
|
|||
*/
|
||||
|
||||
char
|
||||
get_terrain(one, two, three, four)
|
||||
char one, two, three, four;
|
||||
get_terrain(char one, char two, char three, char four)
|
||||
{
|
||||
register int i;
|
||||
int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0;
|
||||
|
|
@ -203,8 +201,7 @@ char one, two, three, four;
|
|||
*/
|
||||
|
||||
void
|
||||
lake_check(place)
|
||||
coord *place;
|
||||
lake_check(coord *place)
|
||||
{
|
||||
NOOP(place);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,15 +18,15 @@
|
|||
|
||||
char outstring[512]; /* ridiculously long string for use with msg */
|
||||
|
||||
bool is_type (struct object *obj, int type);
|
||||
|
||||
/*
|
||||
* add_pack:
|
||||
* Pick up an object and add it to the pack. If the argument is non-null
|
||||
* use it as the linked_list pointer instead of gettting it off the ground.
|
||||
*/
|
||||
bool
|
||||
add_pack(item, silent, packret)
|
||||
register struct linked_list *item, **packret;
|
||||
bool silent;
|
||||
add_pack(struct linked_list *item, bool silent, struct linked_list **packret)
|
||||
{
|
||||
register struct linked_list *ip, *lp = NULL, *ap;
|
||||
register struct object *obj, *op = NULL;
|
||||
|
|
@ -305,9 +305,8 @@ picked_up:
|
|||
* inventory:
|
||||
* list what is in the pack
|
||||
*/
|
||||
inventory(list, type)
|
||||
register struct linked_list *list;
|
||||
register int type;
|
||||
bool
|
||||
inventory(struct linked_list *list, int type)
|
||||
{
|
||||
register struct object *obj;
|
||||
register char ch;
|
||||
|
|
@ -390,8 +389,8 @@ register int type;
|
|||
* pick_up:
|
||||
* Add something to characters pack.
|
||||
*/
|
||||
pick_up(ch)
|
||||
char ch;
|
||||
void
|
||||
pick_up(char ch)
|
||||
{
|
||||
switch (ch) {
|
||||
default:
|
||||
|
|
@ -416,7 +415,7 @@ char ch;
|
|||
* Allow player to inventory a single item
|
||||
*/
|
||||
void
|
||||
picky_inven()
|
||||
picky_inven(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register char ch, mch;
|
||||
|
|
@ -471,12 +470,10 @@ picky_inven()
|
|||
/*
|
||||
* get_item:
|
||||
* pick something out of a pack for a purpose
|
||||
* purpose: NULL if we should be silent (no prompts) *
|
||||
*/
|
||||
struct linked_list *
|
||||
get_item(list, purpose, type)
|
||||
reg struct linked_list *list;
|
||||
char *purpose; /* NULL if we should be silent (no prompts) */
|
||||
int type;
|
||||
get_item(struct linked_list *list, char *purpose, int type)
|
||||
{
|
||||
reg struct linked_list *item;
|
||||
reg struct object *obj;
|
||||
|
|
@ -610,9 +607,8 @@ int type;
|
|||
}
|
||||
}
|
||||
|
||||
pack_char(list, obj)
|
||||
register struct object *obj;
|
||||
struct linked_list *list;
|
||||
char
|
||||
pack_char(struct linked_list *list, struct object *obj)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register char c;
|
||||
|
|
@ -634,8 +630,8 @@ struct linked_list *list;
|
|||
* cur_null:
|
||||
* This updates cur_weapon etc for dropping things
|
||||
*/
|
||||
cur_null(op)
|
||||
reg struct object *op;
|
||||
void
|
||||
cur_null(struct object *op)
|
||||
{
|
||||
if (op == cur_weapon) cur_weapon = NULL;
|
||||
else if (op == cur_armor) cur_armor = NULL;
|
||||
|
|
@ -659,7 +655,8 @@ reg struct object *op;
|
|||
* idenpack:
|
||||
* Identify all the items in the pack
|
||||
*/
|
||||
idenpack()
|
||||
void
|
||||
idenpack(void)
|
||||
{
|
||||
reg struct linked_list *pc;
|
||||
|
||||
|
|
@ -667,9 +664,8 @@ idenpack()
|
|||
whatis(pc);
|
||||
}
|
||||
|
||||
is_type (obj, type)
|
||||
register struct object *obj;
|
||||
register int type;
|
||||
bool
|
||||
is_type (struct object *obj, int type)
|
||||
{
|
||||
register bool current;
|
||||
|
||||
|
|
@ -804,8 +800,8 @@ register int type;
|
|||
return(FALSE);
|
||||
}
|
||||
|
||||
del_pack(item)
|
||||
register struct linked_list *item;
|
||||
void
|
||||
del_pack(struct linked_list *item)
|
||||
{
|
||||
register struct object *obj;
|
||||
|
||||
|
|
@ -827,9 +823,8 @@ register struct linked_list *item;
|
|||
* it to him.
|
||||
*/
|
||||
|
||||
carry_obj(mp, chance)
|
||||
register struct thing *mp;
|
||||
int chance;
|
||||
void
|
||||
carry_obj(struct thing *mp, int chance)
|
||||
{
|
||||
reg struct linked_list *item;
|
||||
reg struct object *obj;
|
||||
|
|
@ -851,74 +846,74 @@ int chance;
|
|||
* avoid it
|
||||
*/
|
||||
if (on(*mp, CARRYDAGGER)) {
|
||||
item = spec_item(RELIC, MUSTY_DAGGER, NULL, NULL);
|
||||
item = spec_item(RELIC, MUSTY_DAGGER, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
|
||||
if (on(*mp, CARRYCLOAK)) {
|
||||
item = spec_item(RELIC, EMORI_CLOAK, NULL, NULL);
|
||||
item = spec_item(RELIC, EMORI_CLOAK, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
|
||||
if (on(*mp, CARRYANKH)) {
|
||||
item = spec_item(RELIC, HEIL_ANKH, NULL, NULL);
|
||||
item = spec_item(RELIC, HEIL_ANKH, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
|
||||
if (on(*mp, CARRYSTAFF)) {
|
||||
item = spec_item(RELIC, MING_STAFF, NULL, NULL);
|
||||
item = spec_item(RELIC, MING_STAFF, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
|
||||
if (on(*mp, CARRYWAND)) {
|
||||
item = spec_item(RELIC, ORCUS_WAND, NULL, NULL);
|
||||
item = spec_item(RELIC, ORCUS_WAND, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
|
||||
if (on(*mp, CARRYROD)) {
|
||||
item = spec_item(RELIC, ASMO_ROD, NULL, NULL);
|
||||
item = spec_item(RELIC, ASMO_ROD, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
|
||||
if (on(*mp, CARRYAMULET)) {
|
||||
item = spec_item(RELIC, YENDOR_AMULET, NULL, NULL);
|
||||
item = spec_item(RELIC, YENDOR_AMULET, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
|
||||
if (on(*mp, CARRYMANDOLIN)) {
|
||||
item = spec_item(RELIC, BRIAN_MANDOLIN, NULL, NULL);
|
||||
item = spec_item(RELIC, BRIAN_MANDOLIN, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
if (on(*mp, CARRYMSTAR)) {
|
||||
item = spec_item(RELIC, HRUGGEK_MSTAR, NULL, NULL);
|
||||
item = spec_item(RELIC, HRUGGEK_MSTAR, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
if (on(*mp, CARRYFLAIL)) {
|
||||
item = spec_item(RELIC, YEENOGHU_FLAIL, NULL, NULL);
|
||||
item = spec_item(RELIC, YEENOGHU_FLAIL, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
}
|
||||
if (on(*mp, CARRYHORN)) {
|
||||
item = spec_item(RELIC, GERYON_HORN, NULL, NULL);
|
||||
item = spec_item(RELIC, GERYON_HORN, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_pos = mp->t_pos;
|
||||
attach(mp->t_pack, item);
|
||||
|
|
@ -927,7 +922,7 @@ int chance;
|
|||
* If it carries gold, give it some
|
||||
*/
|
||||
if (on(*mp, CARRYGOLD) && rnd(100) < chance) {
|
||||
item = spec_item(GOLD, NULL, NULL, NULL);
|
||||
item = spec_item(GOLD, 0, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_count = GOLDCALC + GOLDCALC;
|
||||
obj->o_pos = mp->t_pos;
|
||||
|
|
@ -938,7 +933,7 @@ int chance;
|
|||
* If it carries food, give it some
|
||||
*/
|
||||
if (on(*mp, CARRYFOOD) && rnd(100) < chance) {
|
||||
item = spec_item(FOOD, NULL, NULL, NULL);
|
||||
item = spec_item(FOOD, 0, 0, 0);
|
||||
obj = OBJPTR(item);
|
||||
obj->o_weight = things[TYP_FOOD].mi_wght;
|
||||
obj->o_pos = mp->t_pos;
|
||||
|
|
@ -1041,8 +1036,8 @@ int chance;
|
|||
* he wants (* means everything).
|
||||
*/
|
||||
|
||||
grab(y, x)
|
||||
register y, x;
|
||||
int
|
||||
grab(int y, int x)
|
||||
{
|
||||
register struct linked_list *next_item, *item;
|
||||
register struct object *obj;
|
||||
|
|
|
|||
|
|
@ -14,15 +14,20 @@
|
|||
* See the file LICENSE.TXT for full copyright and licensing information.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "curses.h"
|
||||
#include "rogue.h"
|
||||
|
||||
void conn(int r1, int r2);
|
||||
void door(struct room *rm, coord *cp);
|
||||
|
||||
/*
|
||||
* do_passages:
|
||||
* Draw all the passages on a level.
|
||||
*/
|
||||
|
||||
do_passages()
|
||||
void
|
||||
do_passages(void)
|
||||
{
|
||||
register struct rdes *r1, *r2 = NULL;
|
||||
register int i, j;
|
||||
|
|
@ -130,8 +135,8 @@ do_passages()
|
|||
* Draw a corridor from a room in a certain direction.
|
||||
*/
|
||||
|
||||
conn(r1, r2)
|
||||
int r1, r2;
|
||||
void
|
||||
conn(int r1, int r2)
|
||||
{
|
||||
register struct room *rpf, *rpt = NULL;
|
||||
register char rmt;
|
||||
|
|
@ -266,9 +271,8 @@ int r1, r2;
|
|||
* also enters the door in the exits array of the room.
|
||||
*/
|
||||
|
||||
door(rm, cp)
|
||||
register struct room *rm;
|
||||
register coord *cp;
|
||||
void
|
||||
door(struct room *rm, coord *cp)
|
||||
{
|
||||
struct linked_list *newroom;
|
||||
coord *exit;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@
|
|||
* cleric affecting undead
|
||||
*/
|
||||
|
||||
affect()
|
||||
void
|
||||
affect(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct thing *tp;
|
||||
|
|
@ -121,7 +122,8 @@ annoy:
|
|||
/*
|
||||
* the magic user is going to try and cast a spell
|
||||
*/
|
||||
cast()
|
||||
void
|
||||
cast(void)
|
||||
{
|
||||
register int i, num_spells, spell_ability;
|
||||
int which_spell;
|
||||
|
|
@ -271,7 +273,8 @@ cast()
|
|||
|
||||
/* Constitution bonus */
|
||||
|
||||
const_bonus() /* Hit point adjustment for changing levels */
|
||||
int
|
||||
const_bonus(void) /* Hit point adjustment for changing levels */
|
||||
{
|
||||
if (pstats.s_const > 6 && pstats.s_const <= 14)
|
||||
return(0);
|
||||
|
|
@ -290,7 +293,8 @@ const_bonus() /* Hit point adjustment for changing levels */
|
|||
* Sense gold
|
||||
*/
|
||||
|
||||
gsense()
|
||||
void
|
||||
gsense(void)
|
||||
{
|
||||
/* Only thieves can do this */
|
||||
if (player.t_ctype != C_THIEF) {
|
||||
|
|
@ -324,7 +328,8 @@ gsense()
|
|||
/*
|
||||
* the cleric asks his deity for a spell
|
||||
*/
|
||||
pray()
|
||||
void
|
||||
pray(void)
|
||||
{
|
||||
register int i, num_prayers, prayer_ability;
|
||||
int which_prayer;
|
||||
|
|
@ -488,7 +493,8 @@ pray()
|
|||
* Steal in direction given in delta
|
||||
*/
|
||||
|
||||
steal()
|
||||
void
|
||||
steal(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct thing *tp;
|
||||
|
|
|
|||
|
|
@ -17,14 +17,16 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void res_intelligence(void);
|
||||
void res_wisdom(void);
|
||||
|
||||
|
||||
/*
|
||||
* Increase player's constitution
|
||||
*/
|
||||
|
||||
add_const(cursed)
|
||||
bool cursed;
|
||||
void
|
||||
add_const(bool cursed)
|
||||
{
|
||||
/* Do the potion */
|
||||
if (cursed) {
|
||||
|
|
@ -47,8 +49,8 @@ bool cursed;
|
|||
* Increase player's dexterity
|
||||
*/
|
||||
|
||||
add_dexterity(cursed)
|
||||
bool cursed;
|
||||
void
|
||||
add_dexterity(bool cursed)
|
||||
{
|
||||
int ring_str; /* Value of ring strengths */
|
||||
|
||||
|
|
@ -80,8 +82,8 @@ bool cursed;
|
|||
* add a haste to the player
|
||||
*/
|
||||
|
||||
add_haste(blessed)
|
||||
bool blessed;
|
||||
void
|
||||
add_haste(bool blessed)
|
||||
{
|
||||
int hasttime;
|
||||
|
||||
|
|
@ -110,8 +112,8 @@ bool blessed;
|
|||
/*
|
||||
* Increase player's intelligence
|
||||
*/
|
||||
add_intelligence(cursed)
|
||||
bool cursed;
|
||||
void
|
||||
add_intelligence(bool cursed)
|
||||
{
|
||||
int ring_str; /* Value of ring strengths */
|
||||
|
||||
|
|
@ -141,7 +143,8 @@ bool cursed;
|
|||
/*
|
||||
* this routine makes the hero move slower
|
||||
*/
|
||||
add_slow()
|
||||
void
|
||||
add_slow(void)
|
||||
{
|
||||
if (on(player, ISHASTE)) { /* Already sped up */
|
||||
extinguish(nohaste);
|
||||
|
|
@ -164,8 +167,8 @@ add_slow()
|
|||
* Increase player's strength
|
||||
*/
|
||||
|
||||
add_strength(cursed)
|
||||
bool cursed;
|
||||
void
|
||||
add_strength(bool cursed)
|
||||
{
|
||||
|
||||
if (cursed) {
|
||||
|
|
@ -182,8 +185,8 @@ bool cursed;
|
|||
* Increase player's wisdom
|
||||
*/
|
||||
|
||||
add_wisdom(cursed)
|
||||
bool cursed;
|
||||
void
|
||||
add_wisdom(bool cursed)
|
||||
{
|
||||
int ring_str; /* Value of ring strengths */
|
||||
|
||||
|
|
@ -215,8 +218,8 @@ bool cursed;
|
|||
* Lower a level of experience
|
||||
*/
|
||||
|
||||
lower_level(who)
|
||||
short who;
|
||||
void
|
||||
lower_level(short who)
|
||||
{
|
||||
int fewer, nsides = 0;
|
||||
|
||||
|
|
@ -239,10 +242,8 @@ short who;
|
|||
death(who);
|
||||
}
|
||||
|
||||
quaff(which, flag, is_potion)
|
||||
int which;
|
||||
int flag;
|
||||
bool is_potion;
|
||||
void
|
||||
quaff(int which, int flag, bool is_potion)
|
||||
{
|
||||
register struct object *obj = NULL;
|
||||
register struct linked_list *item, *titem;
|
||||
|
|
@ -625,8 +626,8 @@ bool is_potion;
|
|||
* if called with zero the restore fully
|
||||
*/
|
||||
|
||||
res_dexterity(howmuch)
|
||||
int howmuch;
|
||||
void
|
||||
res_dexterity(int howmuch)
|
||||
{
|
||||
short save_max;
|
||||
int ring_str;
|
||||
|
|
@ -656,7 +657,8 @@ int howmuch;
|
|||
* Restore player's intelligence
|
||||
*/
|
||||
|
||||
res_intelligence()
|
||||
void
|
||||
res_intelligence(void)
|
||||
{
|
||||
short save_max;
|
||||
int ring_str;
|
||||
|
|
@ -680,7 +682,8 @@ res_intelligence()
|
|||
* Restore player's wisdom
|
||||
*/
|
||||
|
||||
res_wisdom()
|
||||
void
|
||||
res_wisdom(void)
|
||||
{
|
||||
short save_max;
|
||||
int ring_str;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
/*
|
||||
* how much food does this ring use up?
|
||||
*/
|
||||
ring_eat(hand)
|
||||
register int hand;
|
||||
int
|
||||
ring_eat(int hand)
|
||||
{
|
||||
if (cur_ring[hand] == NULL)
|
||||
return 0;
|
||||
|
|
@ -45,8 +45,8 @@ register int hand;
|
|||
return 0;
|
||||
}
|
||||
|
||||
ring_on(obj)
|
||||
register struct object *obj;
|
||||
void
|
||||
ring_on(struct object *obj)
|
||||
{
|
||||
register int save_max;
|
||||
char buf[LINELEN];
|
||||
|
|
@ -112,8 +112,7 @@ register struct object *obj;
|
|||
* print ring bonuses
|
||||
*/
|
||||
char *
|
||||
ring_num(obj)
|
||||
register struct object *obj;
|
||||
ring_num(struct object *obj)
|
||||
{
|
||||
static char buf[5];
|
||||
|
||||
|
|
@ -147,7 +146,8 @@ register struct object *obj;
|
|||
/*
|
||||
* Return the effect of the specified ring
|
||||
*/
|
||||
ring_value(type)
|
||||
int
|
||||
ring_value(int type)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,15 +71,17 @@ static char *rip[] = {
|
|||
0
|
||||
};
|
||||
|
||||
char *killname();
|
||||
|
||||
|
||||
|
||||
char *killname(short monst);
|
||||
void scorein(struct sc_ent scores[], int fd);
|
||||
void scoreout(struct sc_ent scores[], FILE *outf);
|
||||
void showpack(char *howso);
|
||||
int update(struct sc_ent top_ten[], unsigned long amount, short quest,
|
||||
char *whoami, short flags, short level, short monst, short ctype,
|
||||
char *system, char *login);
|
||||
|
||||
|
||||
void
|
||||
byebye(sig)
|
||||
int sig;
|
||||
byebye(int sig)
|
||||
{
|
||||
NOOP(sig);
|
||||
if (!isendwin()) {
|
||||
|
|
@ -96,8 +98,8 @@ int sig;
|
|||
* Do something really fun when he dies
|
||||
*/
|
||||
|
||||
death(monst)
|
||||
register short monst;
|
||||
void
|
||||
death(short monst)
|
||||
{
|
||||
register char **dp = rip, *killer;
|
||||
register struct tm *lt;
|
||||
|
|
@ -125,8 +127,7 @@ register short monst;
|
|||
}
|
||||
|
||||
char *
|
||||
killname(monst)
|
||||
register short monst;
|
||||
killname(short monst)
|
||||
{
|
||||
static char mons_name[LINELEN];
|
||||
int i;
|
||||
|
|
@ -162,9 +163,8 @@ register short monst;
|
|||
*/
|
||||
|
||||
/* VARARGS2 */
|
||||
score(amount, flags, monst)
|
||||
unsigned long amount;
|
||||
short monst;
|
||||
void
|
||||
score(unsigned long amount, int flags, short monst)
|
||||
{
|
||||
static struct sc_ent top_ten[NUMSCORE];
|
||||
register struct sc_ent *scp;
|
||||
|
|
@ -626,9 +626,8 @@ void writelog(unsigned long amount, int flags, short monst) {
|
|||
* Convert a character string that has been translated from a
|
||||
* score file by scoreout() back to a score file structure.
|
||||
*/
|
||||
scorein(scores, fd)
|
||||
struct sc_ent scores[];
|
||||
int fd;
|
||||
void
|
||||
scorein(struct sc_ent scores[], int fd)
|
||||
{
|
||||
int i;
|
||||
char scoreline[100];
|
||||
|
|
@ -652,9 +651,8 @@ int fd;
|
|||
* this for compatibility sake since some machines write out fields in
|
||||
* different orders.
|
||||
*/
|
||||
scoreout(scores, outf)
|
||||
struct sc_ent scores[];
|
||||
FILE *outf;
|
||||
void
|
||||
scoreout(struct sc_ent scores[], FILE *outf)
|
||||
{
|
||||
int i;
|
||||
char scoreline[100];
|
||||
|
|
@ -676,8 +674,8 @@ FILE *outf;
|
|||
* showpack:
|
||||
* Display the contents of the hero's pack
|
||||
*/
|
||||
showpack(howso)
|
||||
char *howso;
|
||||
void
|
||||
showpack(char *howso)
|
||||
{
|
||||
reg char *iname;
|
||||
reg int cnt, packnum;
|
||||
|
|
@ -706,7 +704,8 @@ char *howso;
|
|||
refresh();
|
||||
}
|
||||
|
||||
total_winner()
|
||||
void
|
||||
total_winner(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct object *obj;
|
||||
|
|
@ -760,11 +759,10 @@ total_winner()
|
|||
exit(0);
|
||||
}
|
||||
|
||||
update(top_ten, amount, quest, whoami, flags, level, monst, ctype, system, login)
|
||||
struct sc_ent top_ten[];
|
||||
unsigned long amount;
|
||||
short quest, flags, level, monst, ctype;
|
||||
char *whoami, *system, *login;
|
||||
int
|
||||
update(struct sc_ent top_ten[], unsigned long amount, short quest,
|
||||
char *whoami, short flags, short level, short monst, short ctype,
|
||||
char *system, char *login)
|
||||
{
|
||||
register struct sc_ent *scp, *sc2;
|
||||
int retval=0; /* 1 if a change, 0 otherwise */
|
||||
|
|
|
|||
284
arogue5/rogue.h
284
arogue5/rogue.h
|
|
@ -943,48 +943,260 @@ struct spells {
|
|||
int s_flag; /* is the spell blessed/cursed? */
|
||||
};
|
||||
|
||||
struct linked_list *find_mons(), *find_obj(), *get_item(), *new_item(),
|
||||
*new_thing(), *wake_monster(), *get_hurl(),
|
||||
*spec_item(), *creat_item();
|
||||
struct object *wield_weap();
|
||||
struct room *roomin();
|
||||
struct trap *trap_at();
|
||||
|
||||
char *tr_name(), *new(),
|
||||
*vowelstr(), *inv_name(),
|
||||
*ctime(), *num(), *ring_num(), *misc_num(), *blesscurse(), *typ_name(),
|
||||
*weap_name(), *misc_name();
|
||||
coord *rndmove(), *can_shoot(), *fallpos();
|
||||
short randmonster(), id_monst();
|
||||
void quit(int sig), tstp(int sig), auto_save(int sig), bugkill(int sig), endit(int sig);
|
||||
int rnd(), wghtchk(), nohaste(), res_strength(),
|
||||
doctor(), runners(), swander(), unconfuse(), unsee(), fumble(),
|
||||
unclrhead(), unphase(), noslow(), rollwand(), stomach(), sight(),
|
||||
unstink(), suffocate(), cure_disease(), un_itch(), shoot_bolt(),
|
||||
appear(), dust_appear(), unchoke(), alchemy(), trap_look(), strangle(),
|
||||
ring_teleport(), ring_search(), grab();
|
||||
bool blue_light(), can_blink(), creat_mons(), add_pack(),
|
||||
straight_shot(), maze_view(), lit_room(), getdelta(), save_file(),
|
||||
save_game();
|
||||
long check_level();
|
||||
void byebye(int sig), genmonsters();
|
||||
int land(), undance();
|
||||
void _attach(struct linked_list **list, struct linked_list *item);
|
||||
void _detach(struct linked_list **list, struct linked_list *item);
|
||||
void _o_free_list(struct linked_list **ptr);
|
||||
void _t_free_list(struct linked_list **ptr);
|
||||
int ac_compute(void);
|
||||
void activity(void);
|
||||
void add_dexterity(bool cursed);
|
||||
void add_intelligence(bool cursed);
|
||||
bool add_pack(struct linked_list *item, bool silent,
|
||||
struct linked_list **packret);
|
||||
void add_slow(void);
|
||||
void add_wisdom(bool cursed);
|
||||
void addmsg(char *fmt, ...);
|
||||
void affect(void);
|
||||
void aggravate(void);
|
||||
void alchemy(struct object *obj);
|
||||
void appear(void);
|
||||
bool attack(struct thing *mp, struct object *weapon, bool thrown);
|
||||
void auto_save(int sig);
|
||||
char be_trapped(struct thing *th, coord *tc);
|
||||
char *blesscurse(int flags);
|
||||
bool blue_light(bool blessed, bool cursed);
|
||||
void bugkill(int sig);
|
||||
void buy_it(void);
|
||||
void byebye(int sig);
|
||||
void cast(void);
|
||||
bool can_blink(struct thing *tp);
|
||||
coord *can_shoot(coord *er, coord *ee);
|
||||
bool cansee(int y, int x);
|
||||
void carry_obj(struct thing *mp, int chance);
|
||||
long check_level(bool get_spells);
|
||||
void check_residue(struct thing *tp);
|
||||
void chg_str(int amt);
|
||||
void command(void);
|
||||
int const_bonus(void);
|
||||
void corr_move(int dy, int dx);
|
||||
struct linked_list *creat_item(void);
|
||||
bool creat_mons(struct thing *person, short monster, bool report);
|
||||
void create_obj(bool prompt, int which_item, int which_type);
|
||||
void cur_null(struct object *op);
|
||||
void cure_disease(void);
|
||||
void dbotline(WINDOW *scr, char *message);
|
||||
void death(short monst);
|
||||
void del_pack(struct linked_list *item);
|
||||
void destroy_item(struct linked_list *item);
|
||||
int dex_compute(void);
|
||||
int dext_prot(int dexterity);
|
||||
bool diag_ok(coord *sp, coord *ep, struct thing *flgptr);
|
||||
void dip_it(void);
|
||||
void do_daemons(int flag);
|
||||
void do_fuses(int flag);
|
||||
void do_maze(void);
|
||||
void do_motion(struct object *obj, int ydelta, int xdelta, struct thing *tp);
|
||||
void do_move(int dy, int dx);
|
||||
void do_passages(void);
|
||||
void do_post(void);
|
||||
void do_rooms(void);
|
||||
void do_run(char ch);
|
||||
void do_terrain(int basey, int basex, int deltay, int deltax, bool fresh);
|
||||
bool do_zap(bool gotdir, int which, int flag);
|
||||
void doctor(struct thing *tp);
|
||||
void draw_room(struct room *rp);
|
||||
bool drop(struct linked_list *item);
|
||||
bool dropcheck(struct object *op);
|
||||
void dust_appear(void);
|
||||
void eat(void);
|
||||
int encread(char *start, unsigned int size, int inf);
|
||||
int encwrite(char *start, unsigned int size, FILE *outf);
|
||||
void endit(int sig);
|
||||
void endmsg(void);
|
||||
void extinguish(int (*func)());
|
||||
void fall(struct linked_list *item, bool pr);
|
||||
coord *fallpos(coord *pos, bool be_clear, int range);
|
||||
void fatal(char *s);
|
||||
bool fight(coord *mp, struct object *weap, bool thrown);
|
||||
struct linked_list *find_mons(int y, int x);
|
||||
struct linked_list *find_obj(int y, int x);
|
||||
struct delayed_action *find_slot(int (*func)());
|
||||
void fix_stick(struct object *cur);
|
||||
void fumble(void);
|
||||
void fuse(int (*func)(), void *arg, int time, int type);
|
||||
void genmonsters(int least, bool treas);
|
||||
bool get_dir(void);
|
||||
struct linked_list *get_item(struct linked_list *list, char *purpose, int type);
|
||||
int get_str(char *opt, WINDOW *win);
|
||||
int get_worth(struct object *obj);
|
||||
int getbless(void);
|
||||
int getdeath(void);
|
||||
bool getdelta(char match, int *dy, int *dx);
|
||||
int grab(int y, int x);
|
||||
void gsense(void);
|
||||
bool hit_monster(int y, int x, struct object *obj, struct thing *tp);
|
||||
int hitweight(void);
|
||||
short id_monst(char monster);
|
||||
void idenpack(void);
|
||||
void init_colors(void);
|
||||
void init_materials(void);
|
||||
void init_misc(void);
|
||||
void init_names(void);
|
||||
void init_player(void);
|
||||
void init_stones(void);
|
||||
void init_terrain(void);
|
||||
void init_things(void);
|
||||
void init_weapon(struct object *weap, char type);
|
||||
char *inv_name(struct object *obj, bool drop);
|
||||
bool inventory(struct linked_list *list, int type);
|
||||
bool is_current(struct object *obj);
|
||||
bool is_magic(struct object *obj);
|
||||
bool isatrap(char ch);
|
||||
int itemweight(struct object *wh);
|
||||
void kill_daemon(int (*func)());
|
||||
void killed(struct linked_list *item, bool pr, bool points);
|
||||
void lake_check(coord *place);
|
||||
void land(void);
|
||||
void lengthen(int (*func)(), int xtime);
|
||||
void light(coord *cp);
|
||||
bool lit_room(struct room *rp);
|
||||
void look(bool wakeup, bool runend);
|
||||
void lower_level(short who);
|
||||
bool m_use_item(struct thing *monster, coord *monst_pos, coord *defend_pos);
|
||||
short makemonster(bool create);
|
||||
bool maze_view(int y, int x);
|
||||
char *misc_name(struct object *obj);
|
||||
void missile(int ydelta, int xdelta, struct linked_list *item,
|
||||
struct thing *tp);
|
||||
void msg(char *fmt, ...);
|
||||
unsigned long netread(int *error, int size, FILE *stream);
|
||||
int netwrite(unsigned long value, int size, FILE *stream);
|
||||
char *new(int size);
|
||||
struct linked_list *new_item(int size);
|
||||
void new_level(LEVTYPE ltype);
|
||||
void new_monster(struct linked_list *item, short type, coord *cp,
|
||||
bool max_monster);
|
||||
struct linked_list *new_thing(int thing_type);
|
||||
void nohaste(void);
|
||||
void noslow(void);
|
||||
char *num(int n1, int n2);
|
||||
void o_discard(struct linked_list *item);
|
||||
void option(void);
|
||||
char pack_char(struct linked_list *list, struct object *obj);
|
||||
void parse_opts(char *str);
|
||||
bool passwd(void);
|
||||
int pick_one(struct magic_item *magic, int nitems);
|
||||
void pick_up(char ch);
|
||||
void picky_inven(void);
|
||||
void playit(void);
|
||||
void pray(void);
|
||||
bool price_it(void);
|
||||
void quaff(int which, int flag, bool is_potion);
|
||||
void quit(int sig);
|
||||
void raise_level(bool get_spells);
|
||||
short randmonster(bool wander, bool no_unique);
|
||||
void read_scroll(int which, int flag, bool is_scroll);
|
||||
int readchar(void);
|
||||
void res_dexterity(int howmuch);
|
||||
void res_strength(void);
|
||||
bool restore(char *file, char **envp);
|
||||
void restscr(WINDOW *scr);
|
||||
int ring_eat(int hand);
|
||||
char *ring_num(struct object *obj);
|
||||
void ring_on(struct object *obj);
|
||||
void ring_search(void);
|
||||
void ring_teleport(void);
|
||||
int ring_value(int type);
|
||||
int rnd(int range);
|
||||
void rnd_pos(struct room *rp, coord *cp);
|
||||
int rnd_room(void);
|
||||
coord *rndmove(struct thing *who);
|
||||
int roll(int number, int sides);
|
||||
void rollwand(void);
|
||||
struct room *roomin(coord *cp);
|
||||
int rs_restore_file(int inf);
|
||||
int rs_save_file(FILE *savef);
|
||||
void runners(void);
|
||||
void runto(struct thing *runner, coord *spot);
|
||||
bool save(int which, struct thing *who, int adj);
|
||||
bool save_game(void);
|
||||
void score(unsigned long amount, int flags, short monst);
|
||||
void search(bool is_thief, bool door_chime);
|
||||
char secretdoor(int y, int x);
|
||||
void sell(struct thing *tp);
|
||||
void sell_it(void);
|
||||
void set_trap(struct thing *tp, int y, int x);
|
||||
void setup(void);
|
||||
bool shoot_bolt(struct thing *shooter, coord start, coord dir,
|
||||
bool get_points, short reason, char *name, int damage);
|
||||
bool shoot_ok(char ch);
|
||||
char show(int y, int x);
|
||||
void sight(void);
|
||||
struct linked_list *spec_item(int type, int which, int hit, int damage);
|
||||
void start_daemon(int (*func)(), void *arg, int type);
|
||||
void status(bool display);
|
||||
void steal(void);
|
||||
bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);
|
||||
void stomach(void);
|
||||
int str_compute(void);
|
||||
void strangle(void);
|
||||
void strucpy(char *s1, char *s2, int len);
|
||||
void suffocate(void);
|
||||
void swander(void);
|
||||
bool swing(short class, int at_lvl, int op_arm, int wplus);
|
||||
void t_discard(struct linked_list *item);
|
||||
void take_off(void);
|
||||
int teleport(void);
|
||||
void total_winner(void);
|
||||
int totalenc(void);
|
||||
char *tr_name(char ch);
|
||||
struct trap *trap_at(int y, int x);
|
||||
void trap_look(void);
|
||||
void un_itch(void);
|
||||
void unchoke(void);
|
||||
void unclrhead(void);
|
||||
void unconfuse(void);
|
||||
void undance(void);
|
||||
void unphase(void);
|
||||
void unsee(void);
|
||||
void unstink(void);
|
||||
void updpack(bool getmax);
|
||||
void use_mm(int which);
|
||||
char *vowelstr(char *str);
|
||||
void wait_for(WINDOW *win, char ch);
|
||||
struct linked_list *wake_monster(int y, int x);
|
||||
void waste_time(void);
|
||||
char *weap_name(struct object *obj);
|
||||
void wear(void);
|
||||
void wghtchk(void);
|
||||
void whatis(struct linked_list *what);
|
||||
void wield(void);
|
||||
void writelog(unsigned long amount, int flags, short monst);
|
||||
|
||||
#ifdef CHECKTIME
|
||||
int checkout();
|
||||
#endif
|
||||
extern char *md_getusername();
|
||||
extern char *md_gethomedir();
|
||||
extern void md_flushinp();
|
||||
extern char *md_getshell();
|
||||
extern char *md_gethostname();
|
||||
extern void md_dobinaryio();
|
||||
extern char *md_getpass();
|
||||
extern char *md_crypt();
|
||||
extern char *md_getroguedir();
|
||||
extern void md_init();
|
||||
extern char *md_getusername(void);
|
||||
extern char *md_gethomedir(void);
|
||||
extern void md_flushinp(void);
|
||||
extern char *md_getshell(void);
|
||||
extern char *md_gethostname(void);
|
||||
extern char *md_getpass(char *prompt);
|
||||
extern char *md_crypt(char *key, char *salt);
|
||||
extern char *md_getroguedir(void);
|
||||
extern void md_init(void);
|
||||
extern FILE * md_fdopen(int fd, char *mode);
|
||||
extern int md_unlink(char *file);
|
||||
extern int md_normaluser(void);
|
||||
extern int md_getuid(void);
|
||||
extern long md_memused(void);
|
||||
extern void md_reopen_score(void);
|
||||
extern int md_readchar(WINDOW *win);
|
||||
extern int md_shellescape(void);
|
||||
extern int md_srand(int seed);
|
||||
extern int md_rand(void);
|
||||
extern int md_erasechar(void);
|
||||
extern int md_killchar(void);
|
||||
|
||||
/*
|
||||
* Now all the global variables
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@
|
|||
#include "rogue.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
do_rooms()
|
||||
void horiz(int cnt);
|
||||
void vert(int cnt);
|
||||
|
||||
void
|
||||
do_rooms(void)
|
||||
{
|
||||
register int i;
|
||||
register struct room *rp;
|
||||
|
|
@ -99,7 +103,7 @@ do_rooms()
|
|||
|
||||
has_gold = TRUE; /* This room has gold in it */
|
||||
|
||||
item = spec_item(GOLD, NULL, NULL, NULL);
|
||||
item = spec_item(GOLD, 0, 0, 0);
|
||||
cur = OBJPTR(item);
|
||||
|
||||
/* Put the gold into the level list of items */
|
||||
|
|
@ -153,8 +157,8 @@ do_rooms()
|
|||
* Draw a box around a room
|
||||
*/
|
||||
|
||||
draw_room(rp)
|
||||
register struct room *rp;
|
||||
void
|
||||
draw_room(struct room *rp)
|
||||
{
|
||||
register int j, k;
|
||||
|
||||
|
|
@ -181,8 +185,8 @@ register struct room *rp;
|
|||
* draw a horizontal line
|
||||
*/
|
||||
|
||||
horiz(cnt)
|
||||
register int cnt;
|
||||
void
|
||||
horiz(int cnt)
|
||||
{
|
||||
while (cnt--)
|
||||
addch('-');
|
||||
|
|
@ -193,9 +197,8 @@ register int cnt;
|
|||
* pick a random spot in a room
|
||||
*/
|
||||
|
||||
rnd_pos(rp, cp)
|
||||
register struct room *rp;
|
||||
register coord *cp;
|
||||
void
|
||||
rnd_pos(struct room *rp, coord *cp)
|
||||
{
|
||||
cp->x = rp->r_pos.x + rnd(rp->r_max.x-2) + 1;
|
||||
cp->y = rp->r_pos.y + rnd(rp->r_max.y-2) + 1;
|
||||
|
|
@ -210,8 +213,7 @@ register coord *cp;
|
|||
*/
|
||||
|
||||
struct room *
|
||||
roomin(cp)
|
||||
register coord *cp;
|
||||
roomin(coord *cp)
|
||||
{
|
||||
register struct room *rp;
|
||||
|
||||
|
|
@ -226,8 +228,8 @@ register coord *cp;
|
|||
* draw a vertical line
|
||||
*/
|
||||
|
||||
vert(cnt)
|
||||
register int cnt;
|
||||
void
|
||||
vert(int cnt)
|
||||
{
|
||||
register int x, y;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
#include <signal.h>
|
||||
#include "rogue.h"
|
||||
|
||||
bool save_file(FILE *savef);
|
||||
|
||||
typedef struct stat STAT;
|
||||
|
||||
extern char version[], encstr[];
|
||||
|
|
@ -31,7 +33,7 @@ extern char version[], encstr[];
|
|||
STAT sbuf;
|
||||
|
||||
bool
|
||||
save_game()
|
||||
save_game(void)
|
||||
{
|
||||
register FILE *savef;
|
||||
register int c;
|
||||
|
|
@ -122,8 +124,7 @@ auto_save(int sig)
|
|||
* write the saved game on the file
|
||||
*/
|
||||
bool
|
||||
save_file(savef)
|
||||
register FILE *savef;
|
||||
save_file(FILE *savef)
|
||||
{
|
||||
int ret;
|
||||
int slines = LINES;
|
||||
|
|
@ -147,9 +148,8 @@ register FILE *savef;
|
|||
return(ret);
|
||||
}
|
||||
|
||||
restore(file, envp)
|
||||
register char *file;
|
||||
char **envp;
|
||||
bool
|
||||
restore(char *file, char **envp)
|
||||
{
|
||||
register int inf;
|
||||
#ifndef _AIX
|
||||
|
|
@ -264,13 +264,11 @@ char **envp;
|
|||
/*
|
||||
* perform an encrypted write
|
||||
*/
|
||||
encwrite(start, size, outf)
|
||||
register char *start;
|
||||
register unsigned size;
|
||||
register FILE *outf;
|
||||
int
|
||||
encwrite(char *start, unsigned int size, FILE *outf)
|
||||
{
|
||||
register char *ep;
|
||||
register num_written = 0;
|
||||
register int num_written = 0;
|
||||
|
||||
ep = encstr;
|
||||
|
||||
|
|
@ -288,10 +286,8 @@ register FILE *outf;
|
|||
/*
|
||||
* perform an encrypted read
|
||||
*/
|
||||
encread(start, size, inf)
|
||||
register char *start;
|
||||
register unsigned size;
|
||||
register int inf;
|
||||
int
|
||||
encread(char *start, unsigned int size, int inf)
|
||||
{
|
||||
register char *ep;
|
||||
register int read_size;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@
|
|||
/*
|
||||
* let the hero get rid of some type of monster (but not a UNIQUE!)
|
||||
*/
|
||||
genocide()
|
||||
void
|
||||
genocide(void)
|
||||
{
|
||||
register struct linked_list *ip;
|
||||
register struct thing *mp;
|
||||
|
|
@ -37,7 +38,7 @@ genocide()
|
|||
|
||||
/* Print out the monsters */
|
||||
while (num_monst > 0) {
|
||||
register left_limit;
|
||||
int left_limit;
|
||||
|
||||
if (num_monst < num_lines) left_limit = (num_monst+1)/2;
|
||||
else left_limit = num_lines/2;
|
||||
|
|
@ -112,10 +113,8 @@ get_monst:
|
|||
msg("You have wiped out the %s.", monsters[which_monst].m_name);
|
||||
}
|
||||
|
||||
read_scroll(which, flag, is_scroll)
|
||||
register int which;
|
||||
int flag;
|
||||
bool is_scroll;
|
||||
void
|
||||
read_scroll(int which, int flag, bool is_scroll)
|
||||
{
|
||||
register struct object *obj = NULL, *nobj;
|
||||
register struct linked_list *item, *nitem;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,12 @@
|
|||
#include <string.h>
|
||||
#include "rogue.h"
|
||||
|
||||
int rs_read_int(int inf, int *i);
|
||||
int rs_write_int(FILE *savef, int c);
|
||||
int list_size(struct linked_list *l);
|
||||
int rs_write_object_list(FILE *savef, struct linked_list *l);
|
||||
int rs_read_object_list(int inf, struct linked_list **list);
|
||||
|
||||
#define READSTAT (format_error || read_error )
|
||||
#define WRITESTAT (write_error)
|
||||
|
||||
|
|
@ -1712,6 +1718,7 @@ rs_read_rooms(int inf, struct room *r, int count)
|
|||
return(READSTAT);
|
||||
}
|
||||
|
||||
int
|
||||
rs_write_room_reference(FILE *savef, struct room *rp)
|
||||
{
|
||||
int i, room = -1;
|
||||
|
|
@ -2224,7 +2231,7 @@ rs_read_thing(int inf, struct thing *t)
|
|||
return(READSTAT);
|
||||
}
|
||||
|
||||
int
|
||||
void
|
||||
rs_fix_thing(struct thing *t)
|
||||
{
|
||||
struct thing *tp;
|
||||
|
|
@ -2434,6 +2441,7 @@ rs_save_file(FILE *savef)
|
|||
return(WRITESTAT);
|
||||
}
|
||||
|
||||
int
|
||||
rs_restore_file(int inf)
|
||||
{
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -18,14 +18,13 @@
|
|||
#include <string.h>
|
||||
#include "rogue.h"
|
||||
|
||||
void drain(int ymin, int ymax, int xmin, int xmax);
|
||||
|
||||
/*
|
||||
* zap a stick and see what happens
|
||||
*/
|
||||
do_zap(gotdir, which, flag)
|
||||
bool gotdir;
|
||||
int which;
|
||||
int flag;
|
||||
bool
|
||||
do_zap(bool gotdir, int which, int flag)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct object *obj = NULL;
|
||||
|
|
@ -683,8 +682,8 @@ int flag;
|
|||
* Do drain hit points from player shtick
|
||||
*/
|
||||
|
||||
drain(ymin, ymax, xmin, xmax)
|
||||
int ymin, ymax, xmin, xmax;
|
||||
void
|
||||
drain(int ymin, int ymax, int xmin, int xmax)
|
||||
{
|
||||
register int i, j, count;
|
||||
register struct thing *ick;
|
||||
|
|
@ -745,8 +744,8 @@ int ymin, ymax, xmin, xmax;
|
|||
/*
|
||||
* initialize a stick
|
||||
*/
|
||||
fix_stick(cur)
|
||||
register struct object *cur;
|
||||
void
|
||||
fix_stick(struct object *cur)
|
||||
{
|
||||
if (EQUAL(ws_type[cur->o_which], "staff")) {
|
||||
cur->o_weight = 100;
|
||||
|
|
@ -787,13 +786,9 @@ register struct object *cur;
|
|||
* given direction
|
||||
*/
|
||||
|
||||
shoot_bolt(shooter, start, dir, get_points, reason, name, damage)
|
||||
struct thing *shooter;
|
||||
coord start, dir;
|
||||
bool get_points;
|
||||
short reason;
|
||||
char *name;
|
||||
int damage;
|
||||
bool
|
||||
shoot_bolt(struct thing *shooter, coord start, coord dir, bool get_points,
|
||||
short reason, char *name, int damage)
|
||||
{
|
||||
register char dirch = 0, ch;
|
||||
register bool used, change;
|
||||
|
|
|
|||
|
|
@ -18,12 +18,13 @@
|
|||
#include <string.h>
|
||||
#include "rogue.h"
|
||||
|
||||
int extras(void);
|
||||
|
||||
/*
|
||||
* print out the number of charges on a stick
|
||||
*/
|
||||
char *
|
||||
charge_str(obj)
|
||||
register struct object *obj;
|
||||
charge_str(struct object *obj)
|
||||
{
|
||||
static char buf[20];
|
||||
|
||||
|
|
@ -41,9 +42,7 @@ register struct object *obj;
|
|||
* inventory.
|
||||
*/
|
||||
char *
|
||||
inv_name(obj, drop)
|
||||
register struct object *obj;
|
||||
bool drop;
|
||||
inv_name(struct object *obj, bool drop)
|
||||
{
|
||||
register char *pb;
|
||||
|
||||
|
|
@ -296,8 +295,7 @@ bool drop;
|
|||
* Return the name of a weapon.
|
||||
*/
|
||||
char *
|
||||
weap_name(obj)
|
||||
register struct object *obj;
|
||||
weap_name(struct object *obj)
|
||||
{
|
||||
switch (obj->o_type) {
|
||||
case WEAPON:
|
||||
|
|
@ -325,8 +323,8 @@ register struct object *obj;
|
|||
* drop:
|
||||
* put something down
|
||||
*/
|
||||
drop(item)
|
||||
struct linked_list *item;
|
||||
bool
|
||||
drop(struct linked_list *item)
|
||||
{
|
||||
register char ch = 0;
|
||||
register struct linked_list *obj, *nobj;
|
||||
|
|
@ -413,8 +411,8 @@ struct linked_list *item;
|
|||
/*
|
||||
* do special checks for dropping or unweilding|unwearing|unringing
|
||||
*/
|
||||
dropcheck(op)
|
||||
register struct object *op;
|
||||
bool
|
||||
dropcheck(struct object *op)
|
||||
{
|
||||
int save_max;
|
||||
|
||||
|
|
@ -514,8 +512,7 @@ register struct object *op;
|
|||
* return a new thing
|
||||
*/
|
||||
struct linked_list *
|
||||
new_thing(thing_type)
|
||||
int thing_type;
|
||||
new_thing(int thing_type)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct object *cur;
|
||||
|
|
@ -710,8 +707,7 @@ int thing_type;
|
|||
* provide a new item tailored to specification
|
||||
*/
|
||||
struct linked_list *
|
||||
spec_item(type, which, hit, damage)
|
||||
int type, which, hit, damage;
|
||||
spec_item(int type, int which, int hit, int damage)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct object *obj;
|
||||
|
|
@ -787,9 +783,8 @@ int type, which, hit, damage;
|
|||
/*
|
||||
* pick an item out of a list of nitems possible magic items
|
||||
*/
|
||||
pick_one(magic, nitems)
|
||||
register struct magic_item *magic;
|
||||
int nitems;
|
||||
int
|
||||
pick_one(struct magic_item *magic, int nitems)
|
||||
{
|
||||
register struct magic_item *end;
|
||||
register int i;
|
||||
|
|
@ -821,8 +816,7 @@ int nitems;
|
|||
*/
|
||||
|
||||
char *
|
||||
blesscurse(flags)
|
||||
int flags;
|
||||
blesscurse(int flags)
|
||||
{
|
||||
if (flags & ISKNOW) {
|
||||
if (flags & ISCURSED) return("cursed ");
|
||||
|
|
@ -836,7 +830,8 @@ int flags;
|
|||
* extras:
|
||||
* Return the number of extra items to be created
|
||||
*/
|
||||
extras()
|
||||
int
|
||||
extras(void)
|
||||
{
|
||||
reg int i;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,17 +14,20 @@
|
|||
|
||||
#include "curses.h"
|
||||
#include "rogue.h"
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
bool open_market(void);
|
||||
void trans_line(void);
|
||||
char *typ_name(struct object *obj);
|
||||
|
||||
|
||||
/*
|
||||
* buy_it:
|
||||
* Buy the item on which the hero stands
|
||||
*/
|
||||
buy_it()
|
||||
void
|
||||
buy_it(void)
|
||||
{
|
||||
reg int wh;
|
||||
struct linked_list *item;
|
||||
|
|
@ -77,7 +80,8 @@ buy_it()
|
|||
* do_post:
|
||||
* Put a trading post room and stuff on the screen
|
||||
*/
|
||||
do_post()
|
||||
void
|
||||
do_post(void)
|
||||
{
|
||||
coord tp;
|
||||
reg int i;
|
||||
|
|
@ -124,8 +128,8 @@ do_post()
|
|||
* get_worth:
|
||||
* Calculate an objects worth in gold
|
||||
*/
|
||||
get_worth(obj)
|
||||
reg struct object *obj;
|
||||
int
|
||||
get_worth(struct object *obj)
|
||||
{
|
||||
reg int worth, wh;
|
||||
|
||||
|
|
@ -195,7 +199,8 @@ reg struct object *obj;
|
|||
* open_market:
|
||||
* Retruns TRUE when ok do to transacting
|
||||
*/
|
||||
open_market()
|
||||
bool
|
||||
open_market(void)
|
||||
{
|
||||
if (trader >= MAXPURCH && !wizard) {
|
||||
msg("The market is closed. The stairs are that-a-way.");
|
||||
|
|
@ -210,7 +215,8 @@ open_market()
|
|||
* price_it:
|
||||
* Price the object that the hero stands on
|
||||
*/
|
||||
price_it()
|
||||
bool
|
||||
price_it(void)
|
||||
{
|
||||
reg struct linked_list *item;
|
||||
reg struct object *obj;
|
||||
|
|
@ -244,7 +250,8 @@ price_it()
|
|||
* sell_it:
|
||||
* Sell an item to the trading post
|
||||
*/
|
||||
sell_it()
|
||||
void
|
||||
sell_it(void)
|
||||
{
|
||||
reg struct linked_list *item;
|
||||
reg struct object *obj;
|
||||
|
|
@ -291,7 +298,8 @@ sell_it()
|
|||
* trans_line:
|
||||
* Show how many transactions the hero has left
|
||||
*/
|
||||
trans_line()
|
||||
void
|
||||
trans_line(void)
|
||||
{
|
||||
if (!wizard)
|
||||
sprintf(prbuf,"You have %d transactions remaining.",
|
||||
|
|
@ -309,8 +317,7 @@ trans_line()
|
|||
* Return the name for this type of object
|
||||
*/
|
||||
char *
|
||||
typ_name(obj)
|
||||
reg struct object *obj;
|
||||
typ_name(struct object *obj)
|
||||
{
|
||||
static char buff[20];
|
||||
reg int wh;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@
|
|||
* aggravate all the monsters on this level
|
||||
*/
|
||||
|
||||
aggravate()
|
||||
void
|
||||
aggravate(void)
|
||||
{
|
||||
register struct linked_list *mi;
|
||||
|
||||
|
|
@ -35,8 +36,8 @@ aggravate()
|
|||
* returns true if the hero can see a certain coordinate.
|
||||
*/
|
||||
|
||||
cansee(y, x)
|
||||
register int y, x;
|
||||
bool
|
||||
cansee(int y, int x)
|
||||
{
|
||||
register struct room *rer;
|
||||
register int radius;
|
||||
|
|
@ -93,8 +94,7 @@ static struct {
|
|||
};
|
||||
|
||||
long
|
||||
check_level(get_spells)
|
||||
bool get_spells;
|
||||
check_level(bool get_spells)
|
||||
{
|
||||
register int i, j, add = 0;
|
||||
register unsigned long exp;
|
||||
|
|
@ -148,8 +148,8 @@ bool get_spells;
|
|||
* it keeps track of the highest it has been, just in case
|
||||
*/
|
||||
|
||||
chg_str(amt)
|
||||
register int amt;
|
||||
void
|
||||
chg_str(int amt)
|
||||
{
|
||||
register int ring_str; /* ring strengths */
|
||||
register struct stats *ptr; /* for speed */
|
||||
|
|
@ -172,7 +172,7 @@ register int amt;
|
|||
* this routine computes the players current AC without dex bonus's
|
||||
*/
|
||||
int
|
||||
ac_compute()
|
||||
ac_compute(void)
|
||||
{
|
||||
register int ac;
|
||||
|
||||
|
|
@ -194,7 +194,8 @@ ac_compute()
|
|||
/*
|
||||
* this routine computes the players current strength
|
||||
*/
|
||||
str_compute()
|
||||
int
|
||||
str_compute(void)
|
||||
{
|
||||
if (cur_misc[WEAR_GAUNTLET] != NULL &&
|
||||
cur_misc[WEAR_GAUNTLET]->o_which == MM_G_OGRE) {
|
||||
|
|
@ -210,7 +211,8 @@ str_compute()
|
|||
/*
|
||||
* this routine computes the players current dexterity
|
||||
*/
|
||||
dex_compute()
|
||||
int
|
||||
dex_compute(void)
|
||||
{
|
||||
if (cur_misc[WEAR_GAUNTLET] != NULL &&
|
||||
cur_misc[WEAR_GAUNTLET]->o_which == MM_G_DEXTERITY) {
|
||||
|
|
@ -229,9 +231,8 @@ dex_compute()
|
|||
* Check to see if the move is legal if it is diagonal
|
||||
*/
|
||||
|
||||
diag_ok(sp, ep, flgptr)
|
||||
register coord *sp, *ep;
|
||||
struct thing *flgptr;
|
||||
bool
|
||||
diag_ok(coord *sp, coord *ep, struct thing *flgptr)
|
||||
{
|
||||
register int numpaths = 0;
|
||||
|
||||
|
|
@ -252,7 +253,8 @@ struct thing *flgptr;
|
|||
* He wants to eat something, so let him try
|
||||
*/
|
||||
|
||||
eat()
|
||||
void
|
||||
eat(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
|
||||
|
|
@ -282,10 +284,7 @@ eat()
|
|||
* pick a random position around the give (y, x) coordinates
|
||||
*/
|
||||
coord *
|
||||
fallpos(pos, be_clear, range)
|
||||
register coord *pos;
|
||||
bool be_clear;
|
||||
int range;
|
||||
fallpos(coord *pos, bool be_clear, int range)
|
||||
{
|
||||
register int tried, i, j;
|
||||
register char ch;
|
||||
|
|
@ -364,9 +363,7 @@ int range;
|
|||
*/
|
||||
|
||||
struct linked_list *
|
||||
find_mons(y, x)
|
||||
register int y;
|
||||
register int x;
|
||||
find_mons(int y, int x)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct thing *th;
|
||||
|
|
@ -386,9 +383,7 @@ register int x;
|
|||
*/
|
||||
|
||||
struct linked_list *
|
||||
find_obj(y, x)
|
||||
register int y;
|
||||
register int x;
|
||||
find_obj(int y, int x)
|
||||
{
|
||||
register struct linked_list *obj;
|
||||
register struct object *op;
|
||||
|
|
@ -406,7 +401,8 @@ register int x;
|
|||
/*
|
||||
* set up the direction co_ordinate for use in varios "prefix" commands
|
||||
*/
|
||||
get_dir()
|
||||
bool
|
||||
get_dir(void)
|
||||
{
|
||||
register char *prompt;
|
||||
register bool gotit;
|
||||
|
|
@ -446,8 +442,8 @@ get_dir()
|
|||
/*
|
||||
* see if the object is one of the currently used items
|
||||
*/
|
||||
is_current(obj)
|
||||
register struct object *obj;
|
||||
bool
|
||||
is_current(struct object *obj)
|
||||
{
|
||||
if (obj == NULL)
|
||||
return FALSE;
|
||||
|
|
@ -483,11 +479,12 @@ register struct object *obj;
|
|||
/*
|
||||
* Look:
|
||||
* A quick glance all around the player
|
||||
* wakeup: Should we wake up monsters
|
||||
* runend: At end of a run -- for mazes
|
||||
*/
|
||||
|
||||
look(wakeup, runend)
|
||||
bool wakeup; /* Should we wake up monsters */
|
||||
bool runend; /* At end of a run -- for mazes */
|
||||
void
|
||||
look(bool wakeup, bool runend)
|
||||
{
|
||||
register int x, y, radius;
|
||||
register char ch, och;
|
||||
|
|
@ -738,8 +735,8 @@ bool runend; /* At end of a run -- for mazes */
|
|||
* The guy just magically went up a level.
|
||||
*/
|
||||
|
||||
raise_level(get_spells)
|
||||
bool get_spells;
|
||||
void
|
||||
raise_level(bool get_spells)
|
||||
{
|
||||
unsigned long test; /* Next level -- be sure it is not an overflow */
|
||||
|
||||
|
|
@ -766,11 +763,12 @@ static int st_matrix[5][5] = {
|
|||
/*
|
||||
* save:
|
||||
* See if a creature saves against something
|
||||
* which: which type of save
|
||||
* who: who is saving
|
||||
* adj: saving throw adjustment
|
||||
*/
|
||||
save(which, who, adj)
|
||||
int which; /* which type of save */
|
||||
struct thing *who; /* who is saving */
|
||||
int adj; /* saving throw adjustment */
|
||||
bool
|
||||
save(int which, struct thing *who, int adj)
|
||||
{
|
||||
register int need, level;
|
||||
|
||||
|
|
@ -814,8 +812,8 @@ int adj; /* saving throw adjustment */
|
|||
* Figure out what a secret door looks like.
|
||||
*/
|
||||
|
||||
secretdoor(y, x)
|
||||
register int y, x;
|
||||
char
|
||||
secretdoor(int y, int x)
|
||||
{
|
||||
register int i;
|
||||
register struct room *rp;
|
||||
|
|
@ -838,9 +836,8 @@ register int y, x;
|
|||
/*
|
||||
* copy string using unctrl for things
|
||||
*/
|
||||
strucpy(s1, s2, len)
|
||||
register char *s1, *s2;
|
||||
register int len;
|
||||
void
|
||||
strucpy(char *s1, char *s2, int len)
|
||||
{
|
||||
register char *sp;
|
||||
|
||||
|
|
@ -859,8 +856,7 @@ register int len;
|
|||
*/
|
||||
|
||||
char *
|
||||
tr_name(ch)
|
||||
char ch;
|
||||
tr_name(char ch)
|
||||
{
|
||||
register char *s = NULL;
|
||||
|
||||
|
|
@ -890,8 +886,7 @@ char ch;
|
|||
* for printfs: if string starts with a vowel, return "n" for an "an"
|
||||
*/
|
||||
char *
|
||||
vowelstr(str)
|
||||
register char *str;
|
||||
vowelstr(char *str)
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
|
|
@ -911,7 +906,8 @@ register char *str;
|
|||
* Do nothing but let other things happen
|
||||
*/
|
||||
|
||||
waste_time()
|
||||
void
|
||||
waste_time(void)
|
||||
{
|
||||
if (inwhgt) /* if from wghtchk then done */
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -23,10 +23,8 @@
|
|||
* do the actual motion on the screen done by an object traveling
|
||||
* across the room
|
||||
*/
|
||||
do_motion(obj, ydelta, xdelta, tp)
|
||||
register struct object *obj;
|
||||
register int ydelta, xdelta;
|
||||
register struct thing *tp;
|
||||
void
|
||||
do_motion(struct object *obj, int ydelta, int xdelta, struct thing *tp)
|
||||
{
|
||||
|
||||
/*
|
||||
|
|
@ -70,9 +68,8 @@ register struct thing *tp;
|
|||
* Drop an item someplace around here.
|
||||
*/
|
||||
|
||||
fall(item, pr)
|
||||
register struct linked_list *item;
|
||||
bool pr;
|
||||
void
|
||||
fall(struct linked_list *item, bool pr)
|
||||
{
|
||||
register struct object *obj;
|
||||
register struct room *rp;
|
||||
|
|
@ -116,10 +113,8 @@ bool pr;
|
|||
* Does the missile hit the monster
|
||||
*/
|
||||
|
||||
hit_monster(y, x, obj, tp)
|
||||
register int y, x;
|
||||
struct object *obj;
|
||||
register struct thing *tp;
|
||||
bool
|
||||
hit_monster(int y, int x, struct object *obj, struct thing *tp)
|
||||
{
|
||||
static coord mp;
|
||||
|
||||
|
|
@ -144,9 +139,8 @@ register struct thing *tp;
|
|||
* Set up the initial goodies for a weapon
|
||||
*/
|
||||
|
||||
init_weapon(weap, type)
|
||||
register struct object *weap;
|
||||
char type;
|
||||
void
|
||||
init_weapon(struct object *weap, char type)
|
||||
{
|
||||
register struct init_weps *iwp;
|
||||
|
||||
|
|
@ -169,10 +163,8 @@ char type;
|
|||
* Fire a missile in a given direction
|
||||
*/
|
||||
|
||||
missile(ydelta, xdelta, item, tp)
|
||||
int ydelta, xdelta;
|
||||
register struct linked_list *item;
|
||||
register struct thing *tp;
|
||||
void
|
||||
missile(int ydelta, int xdelta, struct linked_list *item, struct thing *tp)
|
||||
{
|
||||
register struct object *obj;
|
||||
register struct linked_list *nitem;
|
||||
|
|
@ -247,8 +239,7 @@ register struct thing *tp;
|
|||
*/
|
||||
|
||||
char *
|
||||
num(n1, n2)
|
||||
register int n1, n2;
|
||||
num(int n1, int n2)
|
||||
{
|
||||
static char numbuf[LINELEN];
|
||||
|
||||
|
|
@ -268,7 +259,8 @@ register int n1, n2;
|
|||
* Pull out a certain weapon
|
||||
*/
|
||||
|
||||
wield()
|
||||
void
|
||||
wield(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct object *obj, *oweapon;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@
|
|||
* Get the armor off of the players back
|
||||
*/
|
||||
|
||||
take_off()
|
||||
void
|
||||
take_off(void)
|
||||
{
|
||||
register struct object *obj;
|
||||
register struct linked_list *item;
|
||||
|
|
@ -52,7 +53,8 @@ take_off()
|
|||
* The player wants to wear something, so let him/her put it on.
|
||||
*/
|
||||
|
||||
wear()
|
||||
void
|
||||
wear(void)
|
||||
{
|
||||
register struct linked_list *item;
|
||||
register struct object *obj;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "curses.h"
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "rogue.h"
|
||||
|
||||
|
|
@ -23,9 +24,8 @@
|
|||
* create_obj:
|
||||
* Create any object for wizard, scroll, magician, or cleric
|
||||
*/
|
||||
create_obj(prompt, which_item, which_type)
|
||||
bool prompt;
|
||||
int which_item, which_type;
|
||||
void
|
||||
create_obj(bool prompt, int which_item, int which_type)
|
||||
{
|
||||
reg struct linked_list *item;
|
||||
reg struct object *obj;
|
||||
|
|
@ -311,7 +311,8 @@ int which_item, which_type;
|
|||
* getbless:
|
||||
* Get a blessing for a wizards object
|
||||
*/
|
||||
getbless()
|
||||
int
|
||||
getbless(void)
|
||||
{
|
||||
reg char bless;
|
||||
|
||||
|
|
@ -328,7 +329,8 @@ getbless()
|
|||
/*
|
||||
* get a non-monster death type
|
||||
*/
|
||||
getdeath()
|
||||
int
|
||||
getdeath(void)
|
||||
{
|
||||
register int i;
|
||||
int which_death;
|
||||
|
|
@ -358,8 +360,8 @@ getdeath()
|
|||
/*
|
||||
* make a monster for the wizard
|
||||
*/
|
||||
makemonster(create)
|
||||
bool create;
|
||||
short
|
||||
makemonster(bool create)
|
||||
{
|
||||
register int i;
|
||||
register short which_monst;
|
||||
|
|
@ -368,7 +370,7 @@ bool create;
|
|||
|
||||
/* Print out the monsters */
|
||||
while (num_monst > 0) {
|
||||
register left_limit;
|
||||
register int left_limit;
|
||||
|
||||
if (num_monst < num_lines) left_limit = (num_monst+1)/2;
|
||||
else left_limit = num_lines/2;
|
||||
|
|
@ -430,7 +432,8 @@ get_monst:
|
|||
* see if user knows password
|
||||
*/
|
||||
|
||||
passwd()
|
||||
bool
|
||||
passwd(void)
|
||||
{
|
||||
register char *sp, c;
|
||||
char buf[LINELEN];
|
||||
|
|
@ -457,7 +460,8 @@ passwd()
|
|||
* Bamf the hero someplace else
|
||||
*/
|
||||
|
||||
teleport()
|
||||
int
|
||||
teleport(void)
|
||||
{
|
||||
register struct room *new_rp, *old_rp = roomin(&hero);
|
||||
register int rm;
|
||||
|
|
@ -525,8 +529,8 @@ teleport()
|
|||
* What a certin object is
|
||||
*/
|
||||
|
||||
whatis(what)
|
||||
struct linked_list *what;
|
||||
void
|
||||
whatis(struct linked_list *what)
|
||||
{
|
||||
register struct object *obj;
|
||||
register struct linked_list *item;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
|
||||
unsigned long int md_htonl(unsigned long int x);
|
||||
unsigned long int md_ntohl(unsigned long int x);
|
||||
|
||||
#ifdef DEBUG
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue