XRogue: convert to ANSI-style function declarations.

This commit is contained in:
John "Elwin" Edwards 2016-03-02 21:13:26 -05:00
parent e8e6e604c3
commit 2853120387
41 changed files with 1281 additions and 908 deletions

View file

@ -24,12 +24,20 @@
int mf_count = 0; /* move_free counter - see actions.c(m_act()) */ int mf_count = 0; /* move_free counter - see actions.c(m_act()) */
int mf_jmpcnt = 0; /* move_free counter for # of jumps */ int mf_jmpcnt = 0; /* move_free counter for # of jumps */
void m_breathe(struct thing *tp);
void m_select(struct thing *th, bool flee);
void m_sonic(struct thing *tp);
void m_spell(struct thing *tp);
void m_summon(struct thing *tp);
bool m_use_it(struct thing *tp, bool flee, struct room *rer, struct room *ree);
bool m_use_pack(struct thing *monster, coord *defend_pos, int dist,
coord *shoot_dir);
/* /*
* Did we disrupt a spell? * Did we disrupt a spell?
*/ */
dsrpt_monster(tp, always, see_him) void
register struct thing *tp; dsrpt_monster(struct thing *tp, bool always, bool see_him)
bool always, see_him;
{ {
switch (tp->t_action) { switch (tp->t_action) {
case A_SUMMON: case A_SUMMON:
@ -58,7 +66,8 @@ bool always, see_him;
} }
} }
dsrpt_player() void
dsrpt_player(void)
{ {
int which, action; int which, action;
struct linked_list *item; struct linked_list *item;
@ -87,7 +96,7 @@ dsrpt_player()
if (purse > 0) { if (purse > 0) {
msg("Your gold goes flying everywhere!"); msg("Your gold goes flying everywhere!");
do { do {
item = spec_item(GOLD, NULL, NULL, NULL); item = spec_item(GOLD, 0, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_count = min(purse, rnd(20)+1); obj->o_count = min(purse, rnd(20)+1);
purse -= obj->o_count; purse -= obj->o_count;
@ -125,8 +134,8 @@ dsrpt_player()
* Otherwise, let it perform its chosen action. * Otherwise, let it perform its chosen action.
*/ */
m_act(tp) void
register struct thing *tp; m_act(struct thing *tp)
{ {
struct object *obj; struct object *obj;
bool flee; /* Are we scared? */ bool flee; /* Are we scared? */
@ -290,8 +299,8 @@ register struct thing *tp;
* Breathe in the chosen direction. * Breathe in the chosen direction.
*/ */
m_breathe(tp) void
register struct thing *tp; m_breathe(struct thing *tp)
{ {
register int damage; register int damage;
register char *breath = NULL; register char *breath = NULL;
@ -399,11 +408,11 @@ register struct thing *tp;
/* /*
* m_select: * m_select:
* Select an action for the monster. * Select an action for the monster.
* flee: True if running away or player is inaccessible in wall
*/ */
m_select(th, flee) void
register struct thing *th; m_select(struct thing *th, bool flee)
register bool flee; /* True if running away or player is inaccessible in wall */
{ {
register struct room *rer, *ree; /* room of chaser, room of chasee */ register struct room *rer, *ree; /* room of chaser, room of chasee */
int dist = INT_MIN; int dist = INT_MIN;
@ -541,8 +550,8 @@ register bool flee; /* True if running away or player is inaccessible in wall */
* The monster is sounding a sonic blast. * The monster is sounding a sonic blast.
*/ */
m_sonic(tp) void
register struct thing *tp; m_sonic(struct thing *tp)
{ {
register int damage; register int damage;
struct object blast = struct object blast =
@ -571,8 +580,8 @@ register struct thing *tp;
* The monster casts a spell. Currently this is limited to * The monster casts a spell. Currently this is limited to
* magic missile. * magic missile.
*/ */
m_spell(tp) void
register struct thing *tp; m_spell(struct thing *tp)
{ {
struct object missile = struct object missile =
{ {
@ -594,8 +603,8 @@ register struct thing *tp;
* Summon aid. * Summon aid.
*/ */
m_summon(tp) void
register struct thing *tp; m_summon(struct thing *tp)
{ {
register char *helpname, *mname; register char *helpname, *mname;
int fail, numsum; int fail, numsum;
@ -668,10 +677,7 @@ register struct thing *tp;
*/ */
bool bool
m_use_it(tp, flee, rer, ree) m_use_it(struct thing *tp, bool flee, struct room *rer, struct room *ree)
register struct thing *tp;
bool flee;
register struct room *rer, *ree;
{ {
int dist; int dist;
register coord *ee = tp->t_dest, *er = &tp->t_pos; register coord *ee = tp->t_dest, *er = &tp->t_pos;
@ -836,7 +842,8 @@ register struct room *rer, *ree;
} }
reap() void
reap(void)
{ {
_t_free_list(&rlist); _t_free_list(&rlist);
} }
@ -844,10 +851,11 @@ reap()
/* /*
* runners: * runners:
* Make all the awake monsters try to do something. * Make all the awake monsters try to do something.
* segments: Number of segments since last called
*/ */
runners(segments) int
int segments; /* Number of segments since last called */ runners(int segments)
{ {
register struct linked_list *item; register struct linked_list *item;
register struct thing *tp = NULL; register struct thing *tp = NULL;
@ -961,11 +969,7 @@ int segments; /* Number of segments since last called */
* Only care about relics and wands for now. * Only care about relics and wands for now.
*/ */
bool bool
m_use_pack(monster, defend_pos, dist, shoot_dir) m_use_pack(struct thing *monster, coord *defend_pos, int dist, coord *shoot_dir)
register struct thing *monster;
coord *defend_pos;
register int dist;
register coord *shoot_dir;
{ {
register struct object *obj; register struct object *obj;
register struct linked_list *pitem, *relic, *stick; register struct linked_list *pitem, *relic, *stick;

View file

@ -18,6 +18,7 @@
#include <curses.h> #include <curses.h>
#include <ctype.h> #include <ctype.h>
#include <string.h>
#include "rogue.h" #include "rogue.h"
/* /*
@ -25,13 +26,9 @@
* given direction * given direction
*/ */
shoot_bolt(shooter, start, dir, get_points, reason, name, damage) void
struct thing *shooter; shoot_bolt(struct thing *shooter, coord start, coord dir, bool get_points,
coord start, dir; short reason, char *name, int damage)
bool get_points;
short reason;
char *name;
int damage;
{ {
unsigned char dirch = 0, ch; unsigned char dirch = 0, ch;
bool used, change, see_him; bool used, change, see_him;

View file

@ -19,16 +19,18 @@
#include <ctype.h> #include <ctype.h>
#include <curses.h> #include <curses.h>
#include <limits.h> #include <limits.h>
#include <stdlib.h>
#include "rogue.h" #include "rogue.h"
bool straight_shot(int ery, int erx, int eey, int eex, coord *shooting);
/* /*
* Canblink checks if the monster can teleport (blink). If so, it will * Canblink checks if the monster can teleport (blink). If so, it will
* try to blink the monster next to the player. * try to blink the monster next to the player.
*/ */
bool bool
can_blink(tp) can_blink(struct thing *tp)
register struct thing *tp;
{ {
register int y, x, index=9; register int y, x, index=9;
coord tryp; /* To hold the coordinates for use in diag_ok */ coord tryp; /* To hold the coordinates for use in diag_ok */
@ -123,8 +125,7 @@ register struct thing *tp;
*/ */
int int
can_shoot(er, ee, shoot_dir) can_shoot(coord *er, coord *ee, coord *shoot_dir)
register coord *er, *ee, *shoot_dir;
{ {
/* /*
* They must be in the same room or very close (at door) * They must be in the same room or very close (at door)
@ -150,15 +151,13 @@ register coord *er, *ee, *shoot_dir;
* Find the spot for the chaser(er) to move closer to the * Find the spot for the chaser(er) to move closer to the
* chasee(ee). Rer is the room of the chaser, and ree is the * chasee(ee). Rer is the room of the chaser, and ree is the
* room of the creature being chased (chasee). * room of the creature being chased (chasee).
* 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
*/ */
chase(tp, ee, rer, ree, flee) void
register struct thing *tp; chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree,
register coord *ee; bool flee)
register struct room *rer, *ree;
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
*/
{ {
int dist, thisdist, monst_dist = INT_MAX; int dist, thisdist, monst_dist = INT_MAX;
register coord *er = &tp->t_pos; register coord *er = &tp->t_pos;
@ -495,8 +494,8 @@ bool flee; /* True if destination (ee) is player and monster is running away
* Make one thing chase another. * Make one thing chase another.
*/ */
do_chase(th) void
register struct thing *th; do_chase(struct thing *th)
{ {
register struct room *orig_rer, /* Original room of chaser */ register struct room *orig_rer, /* Original room of chaser */
*new_room; /* new room of monster */ *new_room; /* new room of monster */
@ -812,8 +811,7 @@ register struct thing *th;
*/ */
struct linked_list * struct linked_list *
get_hurl(tp) get_hurl(struct thing *tp)
register struct thing *tp;
{ {
struct linked_list *arrow=NULL, *bolt=NULL, *rock=NULL, struct linked_list *arrow=NULL, *bolt=NULL, *rock=NULL,
*spear = NULL, *dagger=NULL, *dart=NULL, *aklad=NULL; *spear = NULL, *dagger=NULL, *dart=NULL, *aklad=NULL;
@ -860,9 +858,8 @@ register struct thing *tp;
* Set a monster running after something * Set a monster running after something
*/ */
runto(runner, spot) void
register struct thing *runner; runto(struct thing *runner, coord *spot)
coord *spot;
{ {
if (on(*runner, ISSTONE)) if (on(*runner, ISSTONE))
return; return;
@ -888,9 +885,7 @@ coord *spot;
*/ */
bool bool
straight_shot(ery, erx, eey, eex, shooting) straight_shot(int ery, int erx, int eey, int eex, coord *shooting)
register int ery, erx, eey, eex;
register coord *shooting;
{ {
register int dy, dx; /* Deltas */ register int dy, dx; /* Deltas */
unsigned char ch; unsigned char ch;

View file

@ -24,12 +24,21 @@
#include "mach_dep.h" #include "mach_dep.h"
#include "rogue.h" #include "rogue.h"
void display(void);
void d_level(void);
void u_level(void);
void shell(void);
void nameit(void);
void namemonst(void);
void count_gold(void);
/* /*
* command: * command:
* Process the user commands * Process the user commands
*/ */
command() void
command(void)
{ {
unsigned int ch; unsigned int ch;
struct linked_list *item; struct linked_list *item;
@ -288,7 +297,7 @@ command()
else { else {
after = FALSE; after = FALSE;
player.t_action = A_NIL; player.t_action = A_NIL;
fright(); fright(NULL);
} }
when 'g' : /* Give command: give slime-molds to monsters */ when 'g' : /* Give command: give slime-molds to monsters */
if (player.t_action == A_NIL) { if (player.t_action == A_NIL) {
@ -298,7 +307,7 @@ command()
else { else {
after = FALSE; after = FALSE;
player.t_action = A_NIL; player.t_action = A_NIL;
give(); give(NULL);
} }
when 'G' : when 'G' :
if (player.t_action == A_NIL) { if (player.t_action == A_NIL) {
@ -357,14 +366,14 @@ command()
/* when '\\' : after = FALSE; ident_hero(); */ /* when '\\' : after = FALSE; ident_hero(); */
when '\\' : msg("Charon (the Boatman) looks at you... "); when '\\' : msg("Charon (the Boatman) looks at you... ");
when '/' : after = FALSE; identify(NULL); when '/' : after = FALSE; identify('\0');
when C_COUNT : count_gold(); when C_COUNT : count_gold();
when C_DIP : dip_it(); when C_DIP : dip_it();
when C_DROP : player.t_action = C_DROP; when C_DROP : player.t_action = C_DROP;
drop((struct linked_list *)NULL); drop((struct linked_list *)NULL);
when C_EAT : eat(); when C_EAT : eat();
when C_QUAFF : quaff(-1, NULL, NULL, TRUE); when C_QUAFF : quaff(-1, 0, 0, TRUE);
when C_READ : read_scroll(-1, NULL, TRUE); when C_READ : read_scroll(-1, 0, TRUE);
when C_SETTRAP : set_trap(&player, hero.y, hero.x); when C_SETTRAP : set_trap(&player, hero.y, hero.x);
when C_SEARCH : when C_SEARCH :
if (player.t_action == A_NIL) { if (player.t_action == A_NIL) {
@ -379,7 +388,7 @@ command()
when C_USE : use_mm(-1); when C_USE : use_mm(-1);
when C_WEAR : wear(); when C_WEAR : wear();
when C_WIELD : wield(); when C_WIELD : wield();
when C_ZAP : if (!player_zap(NULL, FALSE)) after=FALSE; when C_ZAP : if (!player_zap(0, FALSE)) after=FALSE;
when C_CAST : cast(); when C_CAST : cast();
when C_CHANT : chant(); when C_CHANT : chant();
when C_PRAY : pray(); when C_PRAY : pray();
@ -638,7 +647,8 @@ command()
* tell the player what is at a certain coordinates assuming * tell the player what is at a certain coordinates assuming
* it can be seen. * it can be seen.
*/ */
display() void
display(void)
{ {
coord c; coord c;
struct linked_list *item; struct linked_list *item;
@ -673,8 +683,7 @@ display()
/*UNUSED*/ /*UNUSED*/
void void
quit(sig) quit(int sig)
int sig;
{ {
register int oy, ox; register int oy, ox;
@ -727,8 +736,8 @@ int sig;
* killed by a program bug instead of voluntarily. * killed by a program bug instead of voluntarily.
*/ */
bugkill(sig) void
int sig; bugkill(int sig)
{ {
signal(sig, quit); /* If we get it again, give up */ signal(sig, quit); /* If we get it again, give up */
if (levtype == OUTSIDE) { if (levtype == OUTSIDE) {
@ -748,8 +757,8 @@ int sig;
* Player gropes about him to find hidden things. * Player gropes about him to find hidden things.
*/ */
search(is_thief, door_chime) void
register bool is_thief, door_chime; search(bool is_thief, bool door_chime)
{ {
register int x, y; register int x, y;
register char ch, /* The trap or door character */ register char ch, /* The trap or door character */
@ -861,7 +870,8 @@ register bool is_thief, door_chime;
* He wants to go down a level * He wants to go down a level
*/ */
d_level() void
d_level(void)
{ {
bool no_phase=FALSE; bool no_phase=FALSE;
char position = winat(hero.y, hero.x); char position = winat(hero.y, hero.x);
@ -962,7 +972,8 @@ d_level()
* He wants to go up a level * He wants to go up a level
*/ */
u_level() void
u_level(void)
{ {
bool no_phase = FALSE; bool no_phase = FALSE;
register struct linked_list *item; register struct linked_list *item;
@ -1053,7 +1064,8 @@ u_level()
* Let him escape for a while * Let him escape for a while
*/ */
shell() void
shell(void)
{ {
/* /*
* Set the terminal back to original mode * Set the terminal back to original mode
@ -1079,7 +1091,8 @@ shell()
/* /*
* see what we want to name -- an item or a monster. * see what we want to name -- an item or a monster.
*/ */
nameit() void
nameit(void)
{ {
char answer; char answer;
@ -1103,9 +1116,8 @@ nameit()
* allow a user to call a potion, scroll, or ring something * allow a user to call a potion, scroll, or ring something
*/ */
nameitem(item, mark) void
struct linked_list *item; nameitem(struct linked_list *item, bool mark)
bool mark;
{ {
register struct object *obj; register struct object *obj;
register char **guess = NULL, *elsewise = NULL; register char **guess = NULL, *elsewise = NULL;
@ -1191,7 +1203,8 @@ bool mark;
/* Name a monster */ /* Name a monster */
namemonst() void
namemonst(void)
{ {
register struct thing *tp; register struct thing *tp;
struct linked_list *item; struct linked_list *item;
@ -1236,7 +1249,8 @@ namemonst()
msg("There is no monster there to name."); msg("There is no monster there to name.");
} }
count_gold() void
count_gold(void)
{ {
if (player.t_action != C_COUNT) { if (player.t_action != C_COUNT) {
msg("You take a break to count your money.. "); msg("You take a break to count your money.. ");
@ -1259,7 +1273,8 @@ count_gold()
* Teleport somewhere, anywhere... * Teleport somewhere, anywhere...
*/ */
do_teleport() void
do_teleport(void)
{ {
int tlev; int tlev;
prbuf[0] = '\0'; prbuf[0] = '\0';

View file

@ -41,7 +41,7 @@ int fusecnt = 0;
* Find an empty slot in the daemon list * Find an empty slot in the daemon list
*/ */
struct delayed_action * struct delayed_action *
d_slot() d_slot(void)
{ {
reg int i; reg int i;
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -57,7 +57,7 @@ d_slot()
* Find an empty slot in the fuses list * Find an empty slot in the fuses list
*/ */
struct delayed_action * struct delayed_action *
f_slot() f_slot(void)
{ {
reg int i; reg int i;
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -74,8 +74,7 @@ f_slot()
*/ */
struct delayed_action * struct delayed_action *
find_slot(func) find_slot(int (*func)())
reg int (*func)();
{ {
reg int i; reg int i;
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -91,9 +90,8 @@ reg int (*func)();
* Start a daemon, takes a function. * Start a daemon, takes a function.
*/ */
start_daemon(dfunc, arg, type) void
reg VOID *arg; start_daemon(int (*dfunc)(), VOID *arg, int type)
reg int type, (*dfunc)();
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -112,8 +110,8 @@ reg int type, (*dfunc)();
* Remove a daemon from the list * Remove a daemon from the list
*/ */
kill_daemon(dfunc) void
reg int (*dfunc)(); kill_daemon(int (*dfunc)())
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
reg int i; reg int i;
@ -140,8 +138,8 @@ reg int (*dfunc)();
* passing the argument to the function. * passing the argument to the function.
*/ */
do_daemons(flag) void
reg int flag; do_daemons(int flag)
{ {
struct delayed_action *dev; struct delayed_action *dev;
int i; int i;
@ -165,9 +163,8 @@ reg int flag;
* Start a fuse to go off in a certain number of turns * Start a fuse to go off in a certain number of turns
*/ */
fuse(dfunc, arg, time, type) void
VOID *arg; fuse(int (*dfunc)(), VOID *arg, int time, int type)
reg int (*dfunc)(), time, type;
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -186,8 +183,8 @@ reg int (*dfunc)(), time, type;
* Increase the time until a fuse goes off * Increase the time until a fuse goes off
*/ */
lengthen(dfunc, xtime) void
reg int (*dfunc)(), xtime; lengthen(int (*dfunc)(), int xtime)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -201,8 +198,8 @@ reg int (*dfunc)(), xtime;
* Put out a fuse * Put out a fuse
*/ */
extinguish(dfunc) void
reg int (*dfunc)(); extinguish(int (*dfunc)())
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -220,8 +217,8 @@ reg int (*dfunc)();
* Decrement counters and start needed fuses * Decrement counters and start needed fuses
*/ */
do_fuses(flag) void
reg int flag; do_fuses(int flag)
{ {
struct delayed_action *wire; struct delayed_action *wire;
int i; int i;
@ -250,7 +247,8 @@ reg int flag;
* Show wizard number of demaons and memory blocks used * Show wizard number of demaons and memory blocks used
*/ */
activity() void
activity(void)
{ {
msg("Daemons = %d : Fuses = %d : Memory Items = %d : Memory Used = %d", msg("Daemons = %d : Fuses = %d : Memory Items = %d : Memory Used = %d",
demoncnt,fusecnt,total,md_memused()); demoncnt,fusecnt,total,md_memused());

View file

@ -24,8 +24,8 @@
* A healing daemon that restors hit points after rest * A healing daemon that restors hit points after rest
*/ */
doctor(tp) void
register struct thing *tp; doctor(struct thing *tp)
{ {
register int ohp; register int ohp;
register int limit, new_points; register int limit, new_points;
@ -111,7 +111,8 @@ register struct thing *tp;
* Called when it is time to start rolling for wandering monsters * Called when it is time to start rolling for wandering monsters
*/ */
swander() void
swander(void)
{ {
start_daemon(rollwand, (VOID *)NULL, BEFORE); start_daemon(rollwand, (VOID *)NULL, BEFORE);
} }
@ -123,7 +124,8 @@ swander()
int between = 0; int between = 0;
rollwand() void
rollwand(void)
{ {
if (++between >= 4) if (++between >= 4)
@ -145,7 +147,8 @@ rollwand()
* this function is a daemon called each turn when the character is a thief * 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)) if (rnd(100) < (2*dex_compute() + 5*pstats.s_lvl))
search(TRUE, FALSE); search(TRUE, FALSE);
@ -156,7 +159,8 @@ trap_look()
* Release the poor player from his confusion * Release the poor player from his confusion
*/ */
unconfuse() void
unconfuse(void)
{ {
turn_off(player, ISHUH); turn_off(player, ISHUH);
msg("You feel less confused now"); msg("You feel less confused now");
@ -167,7 +171,8 @@ unconfuse()
* He lost his see invisible power * He lost his see invisible power
*/ */
unsee() void
unsee(void)
{ {
if (!ISWEARING(R_SEEINVIS)) { if (!ISWEARING(R_SEEINVIS)) {
turn_off(player, CANSEE); turn_off(player, CANSEE);
@ -180,7 +185,8 @@ unsee()
* Remove to-hit handicap from player * Remove to-hit handicap from player
*/ */
unstink() void
unstink(void)
{ {
turn_off(player, HASSTINK); turn_off(player, HASSTINK);
} }
@ -190,7 +196,8 @@ unstink()
* Player is no longer immune to confusion * Player is no longer immune to confusion
*/ */
unclrhead() void
unclrhead(void)
{ {
turn_off(player, ISCLEAR); turn_off(player, ISCLEAR);
msg("The blue aura about your head fades away."); msg("The blue aura about your head fades away.");
@ -201,7 +208,8 @@ unclrhead()
* Player can no longer walk through walls * Player can no longer walk through walls
*/ */
unphase() void
unphase(void)
{ {
turn_off(player, CANINWALL); turn_off(player, CANINWALL);
msg("Your dizzy feeling leaves you."); msg("Your dizzy feeling leaves you.");
@ -215,7 +223,7 @@ unphase()
*/ */
int int
land() land(void)
{ {
turn_off(player, ISFLY); turn_off(player, ISFLY);
msg("You regain your normal weight"); msg("You regain your normal weight");
@ -228,7 +236,8 @@ land()
* He gets his sight back * He gets his sight back
*/ */
sight() void
sight(void)
{ {
if (on(player, ISBLIND)) if (on(player, ISBLIND))
{ {
@ -245,8 +254,7 @@ sight()
*/ */
int int
res_strength(howmuch) res_strength(long howmuch)
long howmuch;
{ {
/* If lost_str is non-zero, restore that amount of strength, /* If lost_str is non-zero, restore that amount of strength,
@ -271,7 +279,8 @@ long howmuch;
* End the hasting * End the hasting
*/ */
nohaste() void
nohaste(void)
{ {
turn_off(player, ISHASTE); turn_off(player, ISHASTE);
msg("You feel yourself slowing down."); msg("You feel yourself slowing down.");
@ -282,7 +291,8 @@ nohaste()
* End the slowing * End the slowing
*/ */
noslow() void
noslow(void)
{ {
turn_off(player, ISSLOW); turn_off(player, ISSLOW);
msg("You feel yourself speeding up."); msg("You feel yourself speeding up.");
@ -293,7 +303,8 @@ noslow()
* If this gets called, the player has suffocated * If this gets called, the player has suffocated
*/ */
suffocate() void
suffocate(void)
{ {
pstats.s_hpt = -1; pstats.s_hpt = -1;
death(D_SUFFOCATION); death(D_SUFFOCATION);
@ -303,7 +314,8 @@ suffocate()
* digest the hero's food * digest the hero's food
*/ */
stomach() void
stomach(void)
{ {
register int oldfood, old_hunger, food_use, i; register int oldfood, old_hunger, food_use, i;
@ -387,7 +399,8 @@ stomach()
* daemon for curing the diseased * daemon for curing the diseased
*/ */
cure_disease() void
cure_disease(void)
{ {
turn_off(player, HASDISEASE); turn_off(player, HASDISEASE);
if (off (player, HASINFEST)) if (off (player, HASINFEST))
@ -400,7 +413,8 @@ cure_disease()
* Become visible again * Become visible again
*/ */
appear() void
appear(void)
{ {
turn_off(player, ISINVIS); turn_off(player, ISINVIS);
PLAYER = VPLAYER; PLAYER = VPLAYER;
@ -413,7 +427,8 @@ appear()
* dust of disappearance wears off * dust of disappearance wears off
*/ */
dust_appear() void
dust_appear(void)
{ {
turn_off(player, ISINVIS); turn_off(player, ISINVIS);
PLAYER = VPLAYER; PLAYER = VPLAYER;
@ -426,7 +441,8 @@ dust_appear()
* the effects of "dust of choking and sneezing" wear off * the effects of "dust of choking and sneezing" wear off
*/ */
unchoke() void
unchoke(void)
{ {
if (!find_slot(unconfuse)) if (!find_slot(unconfuse))
turn_off(player, ISHUH); turn_off(player, ISHUH);
@ -440,8 +456,8 @@ unchoke()
* make some potion for the guy in the Alchemy jug * make some potion for the guy in the Alchemy jug
*/ */
alchemy(obj) void
register struct object *obj; alchemy(struct object *obj)
{ {
register struct object *tobj = NULL; register struct object *tobj = NULL;
register struct linked_list *item; register struct linked_list *item;
@ -492,7 +508,7 @@ register struct object *obj;
*/ */
int int
undance() undance(void)
{ {
turn_off(player, ISDANCE); turn_off(player, ISDANCE);
msg ("Your feet take a break.....whew!"); msg ("Your feet take a break.....whew!");
@ -503,7 +519,8 @@ undance()
* if he has our favorite necklace of strangulation then take damage every turn * if he has our favorite necklace of strangulation then take damage every turn
*/ */
strangle() void
strangle(void)
{ {
if ((pstats.s_hpt -= 6) <= 0) { if ((pstats.s_hpt -= 6) <= 0) {
pstats.s_hpt = -1; pstats.s_hpt = -1;
@ -515,7 +532,8 @@ strangle()
* if he has on the gauntlets of fumbling he might drop his weapon each turn * if he has on the gauntlets of fumbling he might drop his weapon each turn
*/ */
fumble() void
fumble(void)
{ {
register struct linked_list *item; register struct linked_list *item;
@ -557,7 +575,8 @@ fumble()
* it's a lot like trap_look() * it's a lot like trap_look()
*/ */
ring_search() void
ring_search(void)
{ {
if (rnd(75) < (2*dex_compute() + 5*pstats.s_lvl)) search(TRUE, FALSE); if (rnd(75) < (2*dex_compute() + 5*pstats.s_lvl)) search(TRUE, FALSE);
else search(FALSE, FALSE); else search(FALSE, FALSE);
@ -567,7 +586,8 @@ ring_search()
* this is called each turn the hero has the ring of teleportation on * this is called each turn the hero has the ring of teleportation on
*/ */
ring_teleport() void
ring_teleport(void)
{ {
if (rnd(100) < 3) teleport(); if (rnd(100) < 3) teleport();
} }
@ -576,7 +596,8 @@ ring_teleport()
* this is called to charge up the quill of Nagrom * this is called to charge up the quill of Nagrom
*/ */
quill_charge() void
quill_charge(void)
{ {
register struct object *tobj = NULL; register struct object *tobj = NULL;
register struct linked_list *item; register struct linked_list *item;
@ -601,7 +622,8 @@ quill_charge()
* take the skills away gained (or lost) by the potion of skills * take the skills away gained (or lost) by the potion of skills
*/ */
unskill() void
unskill(void)
{ {
if (pstats.s_lvladj != 0) { if (pstats.s_lvladj != 0) {
pstats.s_lvl -= pstats.s_lvladj; pstats.s_lvl -= pstats.s_lvladj;
@ -616,8 +638,7 @@ unskill()
*/ */
int int
cloak_charge(obj) cloak_charge(struct object *obj)
register struct object *obj;
{ {
if (obj->o_charges < 1) if (obj->o_charges < 1)
obj->o_charges = 1; obj->o_charges = 1;
@ -629,7 +650,8 @@ register struct object *obj;
* He lost his fire resistance * He lost his fire resistance
*/ */
nofire() void
nofire(void)
{ {
if (!ISWEARING(R_FIRE)) { if (!ISWEARING(R_FIRE)) {
turn_off(player, NOFIRE); turn_off(player, NOFIRE);
@ -642,7 +664,8 @@ nofire()
* He lost his cold resistance * He lost his cold resistance
*/ */
nocold() void
nocold(void)
{ {
if (!ISWEARING(R_WARMTH)) { if (!ISWEARING(R_WARMTH)) {
turn_off(player, NOCOLD); turn_off(player, NOCOLD);
@ -655,7 +678,8 @@ nocold()
* He lost his protection from lightning * He lost his protection from lightning
*/ */
nobolt() void
nobolt(void)
{ {
turn_off(player, NOBOLT); turn_off(player, NOBOLT);
msg("Your skin loses its bluish tint"); msg("Your skin loses its bluish tint");
@ -666,8 +690,8 @@ nobolt()
* an artifact eats gold * an artifact eats gold
*/ */
eat_gold(obj) void
register struct object *obj; eat_gold(struct object *obj)
{ {
if (purse == 250) if (purse == 250)
msg("%s.. Bids you to find some more gold. ", inv_name(obj, FALSE)); msg("%s.. Bids you to find some more gold. ", inv_name(obj, FALSE));
@ -691,7 +715,8 @@ register struct object *obj;
* give the hero back some spell points * give the hero back some spell points
*/ */
spell_recovery() void
spell_recovery(void)
{ {
int time; int time;
@ -705,7 +730,8 @@ spell_recovery()
* give the hero back some prayer points * give the hero back some prayer points
*/ */
prayer_recovery() void
prayer_recovery(void)
{ {
int time; int time;
@ -719,7 +745,8 @@ prayer_recovery()
* give the hero back some chant points * give the hero back some chant points
*/ */
chant_recovery() void
chant_recovery(void)
{ {
int time; int time;

View file

@ -24,7 +24,8 @@
* He wants to eat something, so let him try * He wants to eat something, so let him try
*/ */
eat() void
eat(void)
{ {
register struct linked_list *item; register struct linked_list *item;
int which; int which;

View file

@ -26,11 +26,9 @@
* the reason code if the defender is killed. Otherwise return 0. * the reason code if the defender is killed. Otherwise return 0.
*/ */
effect(att, def, weap, thrown, see_att, see_def) int
register struct thing *att, *def; effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
struct object *weap; bool see_att, bool see_def)
bool thrown;
register bool see_att, see_def;
{ {
register bool att_player, def_player; register bool att_player, def_player;
char attname[LINELEN+1], defname[LINELEN+1]; char attname[LINELEN+1], defname[LINELEN+1];

View file

@ -15,14 +15,15 @@
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
int packweight(struct thing *tp);
/* /*
* updpack: * updpack:
* Update his pack weight and adjust fooduse accordingly * Update his pack weight and adjust fooduse accordingly
*/ */
updpack(getmax, tp) void
int getmax; updpack(int getmax, struct thing *tp)
struct thing *tp;
{ {
reg int topcarry, curcarry; reg int topcarry, curcarry;
@ -52,8 +53,8 @@ struct thing *tp;
* Get the total weight of the hero's pack * Get the total weight of the hero's pack
*/ */
packweight(tp) int
register struct thing *tp; packweight(struct thing *tp)
{ {
reg struct object *obj; reg struct object *obj;
reg struct linked_list *pc; reg struct linked_list *pc;
@ -89,8 +90,8 @@ register struct thing *tp;
* Get the weight of an object * Get the weight of an object
*/ */
itemweight(wh) int
reg struct object *wh; itemweight(struct object *wh)
{ {
reg int weight; reg int weight;
reg int ac; reg int ac;
@ -120,8 +121,8 @@ reg struct object *wh;
* Get hero's carrying ability above norm * Get hero's carrying ability above norm
*/ */
playenc(tp) int
register struct thing *tp; playenc(struct thing *tp)
{ {
register int strength; register int strength;
@ -136,8 +137,8 @@ register struct thing *tp;
* Get total weight that the hero can carry * Get total weight that the hero can carry
*/ */
totalenc(tp) int
register struct thing *tp; totalenc(struct thing *tp)
{ {
reg int wtotal; reg int wtotal;
@ -157,11 +158,11 @@ register struct thing *tp;
* See if the hero can carry his pack * See if the hero can carry his pack
*/ */
wghtchk() void
wghtchk(void)
{ {
reg int dropchk, err = TRUE; reg int dropchk, err = TRUE;
reg char ch; reg char ch;
int wghtchk();
inwhgt = TRUE; inwhgt = TRUE;
if (pstats.s_pack > pstats.s_carry) { if (pstats.s_pack > pstats.s_carry) {
@ -195,7 +196,8 @@ wghtchk()
* -1 hit for heavy pack weight * -1 hit for heavy pack weight
*/ */
hitweight() int
hitweight(void)
{ {
return(2 - foodlev); return(2 - foodlev);
} }

View file

@ -19,6 +19,7 @@
#include <curses.h> #include <curses.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#include "rogue.h" #include "rogue.h"
#define CONF_DAMAGE -1 #define CONF_DAMAGE -1
@ -26,15 +27,23 @@
#define DEST_DAMAGE -3 #define DEST_DAMAGE -3
#define DRAIN_DAMAGE -4 #define DRAIN_DAMAGE -4
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, bool see_att, bool see_def, char *er, char *ee,
bool back_stab, bool thrown, bool short_msg);
void miss(struct object *weapon, bool see_att, bool see_def, char *er, char *ee,
bool thrown, bool short_msg);
int add_dam(short str);
int hung_dam(void);
int killed_chance = 0; /* cumulative chance for goodies to loose it */ int killed_chance = 0; /* cumulative chance for goodies to loose it */
/* /*
* returns true if player has a any chance to hit the monster * returns true if player has a any chance to hit the monster
*/ */
player_can_hit(tp, weap) bool
register struct thing *tp; player_can_hit(struct thing *tp, struct object *weap)
register struct object *weap;
{ {
if (off(*tp, CMAGICHIT) && off(*tp, BMAGICHIT) && off(*tp, MAGICHIT)) if (off(*tp, CMAGICHIT) && off(*tp, BMAGICHIT) && off(*tp, MAGICHIT))
return(TRUE); return(TRUE);
@ -62,10 +71,8 @@ register struct object *weap;
* The player attacks the monster. * The player attacks the monster.
*/ */
fight(mp, weap, thrown) bool
register coord *mp; fight(coord *mp, struct object *weap, bool thrown)
struct object *weap;
bool thrown;
{ {
register struct thing *tp; register struct thing *tp;
register struct linked_list *item; register struct linked_list *item;
@ -226,10 +233,8 @@ bool thrown;
* The monster attacks the player * The monster attacks the player
*/ */
attack(mp, weapon, thrown) bool
register struct thing *mp; attack(struct thing *mp, struct object *weapon, bool thrown)
register struct object *weapon;
bool thrown;
{ {
register char *mname; register char *mname;
register bool see_att, did_hit = FALSE; register bool see_att, did_hit = FALSE;
@ -305,9 +310,8 @@ bool thrown;
* returns true if the swing hits * returns true if the swing hits
*/ */
swing(class, at_lvl, op_arm, wplus) bool
short class; swing(short class, int at_lvl, int op_arm, int wplus)
int at_lvl, op_arm, wplus;
{ {
register int res = rnd(20)+1; register int res = rnd(20)+1;
register int need; register int need;
@ -327,12 +331,9 @@ int at_lvl, op_arm, wplus;
* Roll several attacks * Roll several attacks
*/ */
roll_em(att_er, def_er, weap, hurl, cur_weapon, back_stab) bool
struct thing *att_er, *def_er; roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
struct object *weap; bool hurl, struct object *cur_weapon, bool back_stab)
bool hurl;
struct object *cur_weapon;
bool back_stab;
{ {
register struct stats *att, *def; register struct stats *att, *def;
register char *cp = NULL; register char *cp = NULL;
@ -739,9 +740,7 @@ bool back_stab;
*/ */
char * char *
prname(who, upper) prname(char *who, bool upper)
register char *who;
bool upper;
{ {
static char tbuf[LINELEN]; static char tbuf[LINELEN];
@ -766,11 +765,9 @@ bool upper;
* Print a message to indicate a succesful hit * Print a message to indicate a succesful hit
*/ */
hit(weapon, see_att, see_def, er, ee, back_stab, thrown, short_msg) void
register struct object *weapon; hit(struct object *weapon, bool see_att, bool see_def, char *er, char *ee,
bool see_att, see_def; bool back_stab, bool thrown, bool short_msg)
register char *er, *ee;
bool back_stab, thrown, short_msg;
{ {
register char *s = NULL; register char *s = NULL;
char att_name[LINELEN], /* Name of attacker */ char att_name[LINELEN], /* Name of attacker */
@ -830,11 +827,9 @@ bool back_stab, thrown, short_msg;
* Print a message to indicate a poor swing * Print a message to indicate a poor swing
*/ */
miss(weapon, see_att, see_def, er, ee, thrown, short_msg) void
register struct object *weapon; miss(struct object *weapon, bool see_att, bool see_def, char *er, char *ee,
bool see_att, see_def; bool thrown, bool short_msg)
register char *er, *ee;
bool thrown, short_msg;
{ {
register char *s = NULL; register char *s = NULL;
char att_name[LINELEN], /* Name of attacker */ char att_name[LINELEN], /* Name of attacker */
@ -874,8 +869,8 @@ bool thrown, short_msg;
* compute to-hit bonus for dexterity * compute to-hit bonus for dexterity
*/ */
dext_plus(dexterity) int
register int dexterity; dext_plus(int dexterity)
{ {
return (dexterity > 10 ? (dexterity-13)/3 : (dexterity-10)/3); return (dexterity > 10 ? (dexterity-13)/3 : (dexterity-10)/3);
} }
@ -886,8 +881,8 @@ register int dexterity;
* compute armor class bonus for dexterity * compute armor class bonus for dexterity
*/ */
dext_prot(dexterity) int
register int dexterity; dext_prot(int dexterity)
{ {
return ((dexterity-10)/2); return ((dexterity-10)/2);
} }
@ -897,8 +892,8 @@ register int dexterity;
* compute bonus/penalties for strength on the "to hit" roll * compute bonus/penalties for strength on the "to hit" roll
*/ */
str_plus(str) int
register short str; str_plus(short str)
{ {
return((str-10)/3); return((str-10)/3);
} }
@ -908,8 +903,8 @@ register short str;
* compute additional damage done for exceptionally high or low strength * compute additional damage done for exceptionally high or low strength
*/ */
add_dam(str) int
register short str; add_dam(short str)
{ {
return((str-9)/2); return((str-9)/2);
} }
@ -919,7 +914,8 @@ register short str;
* Calculate damage depending on players hungry state * Calculate damage depending on players hungry state
*/ */
hung_dam() int
hung_dam(void)
{ {
reg int howmuch = 0; reg int howmuch = 0;
@ -938,8 +934,8 @@ hung_dam()
* Returns true if an object radiates magic * Returns true if an object radiates magic
*/ */
is_magic(obj) bool
register struct object *obj; is_magic(struct object *obj)
{ {
switch (obj->o_type) switch (obj->o_type)
{ {
@ -963,9 +959,8 @@ register struct object *obj;
* Called to put a monster to death * Called to put a monster to death
*/ */
killed(item, pr, points, treasure) void
register struct linked_list *item; killed(struct linked_list *item, bool pr, bool points, bool treasure)
bool pr, points, treasure;
{ {
register struct thing *tp, *mp; register struct thing *tp, *mp;
register struct linked_list *pitem, *nexti, *mitem; register struct linked_list *pitem, *nexti, *mitem;
@ -1115,9 +1110,7 @@ bool pr, points, treasure;
*/ */
struct linked_list * struct linked_list *
wield_weap(thrown, mp) wield_weap(struct object *thrown, struct thing *mp)
struct object *thrown;
struct thing *mp;
{ {
int look_for = 0, /* The projectile weapon we are looking for */ int look_for = 0, /* The projectile weapon we are looking for */
new_rate, /* The rating of a prospective weapon */ new_rate, /* The rating of a prospective weapon */
@ -1198,8 +1191,9 @@ struct thing *mp;
return(candidate); return(candidate);
} }
explode(tp)
register struct thing *tp; void
explode(struct thing *tp)
{ {
register int x,y, damage; register int x,y, damage;
@ -1253,11 +1247,8 @@ register struct thing *tp;
* Called when one monster attacks another monster. * Called when one monster attacks another monster.
*/ */
skirmish(attacker, mp, weap, thrown) bool
register struct thing *attacker; skirmish(struct thing *attacker, coord *mp, struct object *weap, bool thrown)
register coord *mp;
struct object *weap;
bool thrown;
{ {
register struct thing *defender; register struct thing *defender;
register struct linked_list *item; register struct linked_list *item;

View file

@ -299,7 +299,8 @@ static struct item_list item_help[] = {
0, 0 0, 0
}; };
ident_hero() void
ident_hero(void)
{ {
bool doit = TRUE; bool doit = TRUE;
@ -475,7 +476,8 @@ ident_hero()
* Real Help * Real Help
*/ */
help() void
help(void)
{ {
register struct h_list *strp = helpstr; register struct h_list *strp = helpstr;
register struct item_list *itemp = item_help; register struct item_list *itemp = item_help;
@ -587,8 +589,8 @@ help()
* Tell the player what a certain thing is. * Tell the player what a certain thing is.
*/ */
identify(ch) void
register unsigned char ch; identify(unsigned char ch)
{ {
register char *str = NULL; register char *str = NULL;

View file

@ -105,10 +105,8 @@ struct words metal[NMETAL] = {
* right amounts * right amounts
*/ */
badcheck(name, magic, bound) void
char *name; badcheck(char *name, struct magic_item *magic, int bound)
register struct magic_item *magic;
register int bound;
{ {
register struct magic_item *end; register struct magic_item *end;
@ -128,7 +126,8 @@ register int bound;
* Initialize the potion color scheme for this time * Initialize the potion color scheme for this time
*/ */
init_colors() void
init_colors(void)
{ {
register int i; register int i;
register char *str; register char *str;
@ -152,7 +151,8 @@ init_colors()
* do any initialization for food * do any initialization for food
*/ */
init_foods() void
init_foods(void)
{ {
register int i; register int i;
@ -168,7 +168,8 @@ init_foods()
* Initialize the construction materials for wands and staffs * Initialize the construction materials for wands and staffs
*/ */
init_materials() void
init_materials(void)
{ {
register int i; register int i;
register char *str; register char *str;
@ -203,7 +204,8 @@ init_materials()
* do any initialization for miscellaneous magic * do any initialization for miscellaneous magic
*/ */
init_misc() void
init_misc(void)
{ {
register int i; register int i;
@ -221,7 +223,8 @@ init_misc()
* Generate the names of the various scrolls * Generate the names of the various scrolls
*/ */
init_names() void
init_names(void)
{ {
register int nsyl; register int nsyl;
register char *cp, *sp; register char *cp, *sp;
@ -258,7 +261,8 @@ init_names()
* roll up the rogue * roll up the rogue
*/ */
init_player() void
init_player(void)
{ {
int stat_total, round = 0, minimum, maximum, ch, i, j = 0; int stat_total, round = 0, minimum, maximum, ch, i, j = 0;
short do_escape, *our_stats[NUMABILITIES-1]; short do_escape, *our_stats[NUMABILITIES-1];
@ -790,7 +794,8 @@ init_player()
* Initialize the ring stone setting scheme for this time * Initialize the ring stone setting scheme for this time
*/ */
init_stones() void
init_stones(void)
{ {
register int i; register int i;
register char *str; register char *str;
@ -815,7 +820,8 @@ init_stones()
* Initialize the probabilities for types of things * Initialize the probabilities for types of things
*/ */
init_things() void
init_things(void)
{ {
register struct magic_item *mp; register struct magic_item *mp;

View file

@ -22,6 +22,8 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
void doadd(char *fmt, va_list ap);
/* /*
* msg: * msg:
* Display a message at the top of the screen. * Display a message at the top of the screen.
@ -77,7 +79,8 @@ addmsg(char *fmt, ...)
* player with the --More-- string. Then erase the message. * player with the --More-- string. Then erase the message.
*/ */
rmmsg() void
rmmsg(void)
{ {
if (mpos) { if (mpos) {
wclear(msgw); wclear(msgw);
@ -96,7 +99,8 @@ rmmsg()
* is up there with the --More--) * is up there with the --More--)
*/ */
endmsg() void
endmsg(void)
{ {
/* Needed to track where we are for 5.0 (PC) curses */ /* Needed to track where we are for 5.0 (PC) curses */
register int x, y; register int x, y;
@ -141,6 +145,7 @@ endmsg()
draw(msgw); draw(msgw);
} }
void
doadd(char *fmt, va_list ap) doadd(char *fmt, va_list ap)
{ {
vsprintf((char *) &msgbuf[newpos], fmt, ap); vsprintf((char *) &msgbuf[newpos], fmt, ap);
@ -153,9 +158,8 @@ doadd(char *fmt, va_list ap)
* flgptr will be NULL if we don't know what the monster is yet! * flgptr will be NULL if we don't know what the monster is yet!
*/ */
step_ok(y, x, can_on_monst, flgptr) bool
register int y, x, can_on_monst; step_ok(int y, int x, int can_on_monst, struct thing *flgptr)
register struct thing *flgptr;
{ {
/* can_on_monst = MONSTOK if all we care about are physical obstacles */ /* can_on_monst = MONSTOK if all we care about are physical obstacles */
register struct linked_list *item; register struct linked_list *item;
@ -222,6 +226,7 @@ register struct thing *flgptr;
* returns true if it is ok for type to shoot over ch * returns true if it is ok for type to shoot over ch
*/ */
bool
shoot_ok(int ch) shoot_ok(int ch)
{ {
switch (ch) switch (ch)
@ -240,10 +245,11 @@ shoot_ok(int ch)
/* /*
* status: * status:
* Display the important stats line. Keep the cursor where it was. * Display the important stats line. Keep the cursor where it was.
* display: is TRUE, display unconditionally
*/ */
status(display) void
bool display; /* is TRUE, display unconditionally */ status(bool display)
{ {
register struct stats *stat_ptr, *max_ptr; register struct stats *stat_ptr, *max_ptr;
register int oy = 0, ox = 0, temp; register int oy = 0, ox = 0, temp;
@ -377,8 +383,8 @@ line_two:
* Sit around until the guy types the right key * Sit around until the guy types the right key
*/ */
wait_for(ch) void
register char ch; wait_for(char ch)
{ {
register char c; register char c;
@ -407,10 +413,9 @@ register char ch;
* typed and then redraw the starting screen. * typed and then redraw the starting screen.
*/ */
over_win(oldwin, newin, maxy, maxx, cursory, cursorx, redraw) void
WINDOW *oldwin, *newin; over_win(WINDOW *oldwin, WINDOW *newin, int maxy, int maxx, int cursory,
int maxy, maxx, cursory, cursorx; int cursorx, char redraw)
char redraw;
{ {
char blanks[LINELEN+1]; char blanks[LINELEN+1];
register int line, i; register int line, i;
@ -460,9 +465,8 @@ char redraw;
* function used to display a window and wait before returning * function used to display a window and wait before returning
*/ */
show_win(scr, message) void
register WINDOW *scr; show_win(WINDOW *scr, char *message)
char *message;
{ {
mvwaddstr(scr, 0, 0, message); mvwaddstr(scr, 0, 0, message);
touchwin(scr); touchwin(scr);
@ -477,9 +481,8 @@ char *message;
* Displays message on bottom line and waits for a space to return * Displays message on bottom line and waits for a space to return
*/ */
dbotline(scr,message) void
WINDOW *scr; dbotline(WINDOW *scr, char *message)
char *message;
{ {
mvwaddstr(scr,lines-1,0,message); mvwaddstr(scr,lines-1,0,message);
draw(scr); draw(scr);
@ -491,8 +494,8 @@ char *message;
* Restores the screen to the terminal * Restores the screen to the terminal
*/ */
restscr(scr) void
WINDOW *scr; restscr(WINDOW *scr)
{ {
clearok(scr,TRUE); clearok(scr,TRUE);
touchwin(scr); touchwin(scr);
@ -506,10 +509,7 @@ WINDOW *scr;
*/ */
unsigned long unsigned long
netread(error, size, stream) netread(int *error, int size, FILE *stream)
int *error;
int size;
FILE *stream;
{ {
unsigned long result = 0L, /* What we read in */ unsigned long result = 0L, /* What we read in */
partial; /* Partial value */ partial; /* Partial value */
@ -542,12 +542,13 @@ FILE *stream;
/* /*
* netwrite: * netwrite:
* Write out a byte, short, or long machine independently. * 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) int
unsigned long value; /* What to write */ netwrite(unsigned long value, int size, FILE *stream)
int size; /* How much to write out */
FILE *stream; /* Where to write it */
{ {
int i; /* Goes through value one byte at a time */ int i; /* Goes through value one byte at a time */
char outc; /* The next character to be written */ char outc; /* The next character to be written */

View file

@ -21,13 +21,16 @@
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
void r_discard(struct linked_list *item);
void t_discard(struct linked_list *item);
/* /*
* detach: * detach:
* Takes an item out of whatever linked list it might be in * Takes an item out of whatever linked list it might be in
*/ */
_detach(list, item) void
register struct linked_list **list, *item; _detach(struct linked_list **list, struct linked_list *item)
{ {
if (*list == item) if (*list == item)
*list = next(item); *list = next(item);
@ -42,8 +45,8 @@ register struct linked_list **list, *item;
* add an item to the head of a list * add an item to the head of a list
*/ */
_attach(list, item) void
register struct linked_list **list, *item; _attach(struct linked_list **list, struct linked_list *item)
{ {
if (*list != NULL) if (*list != NULL)
{ {
@ -65,8 +68,8 @@ register struct linked_list **list, *item;
* Throw the whole object list away * Throw the whole object list away
*/ */
_o_free_list(ptr) void
register struct linked_list **ptr; _o_free_list(struct linked_list **ptr)
{ {
register struct linked_list *item; register struct linked_list *item;
@ -83,8 +86,8 @@ register struct linked_list **ptr;
* free up an item and its object(and maybe contents) * free up an item and its object(and maybe contents)
*/ */
o_discard(item) void
register struct linked_list *item; o_discard(struct linked_list *item)
{ {
register struct object *obj; register struct object *obj;
@ -102,8 +105,8 @@ register struct linked_list *item;
discard the item (monster) itself as that belong to mlist. discard the item (monster) itself as that belong to mlist.
*/ */
_r_free_fire_list(ptr) void
register struct linked_list **ptr; _r_free_fire_list(struct linked_list **ptr)
{ {
register struct linked_list *item; register struct linked_list *item;
@ -119,8 +122,8 @@ register struct linked_list **ptr;
* Throw the whole list of room exits away * Throw the whole list of room exits away
*/ */
_r_free_list(ptr) void
register struct linked_list **ptr; _r_free_list(struct linked_list **ptr)
{ {
register struct linked_list *item; register struct linked_list *item;
@ -137,8 +140,8 @@ register struct linked_list **ptr;
* free up an item and its room * free up an item and its room
*/ */
r_discard(item) void
register struct linked_list *item; r_discard(struct linked_list *item)
{ {
total -= 2; total -= 2;
FREE(DOORPTR(item)); FREE(DOORPTR(item));
@ -150,8 +153,8 @@ register struct linked_list *item;
* Throw the whole thing list away * Throw the whole thing list away
*/ */
_t_free_list(ptr) void
register struct linked_list **ptr; _t_free_list(struct linked_list **ptr)
{ {
register struct linked_list *item; register struct linked_list *item;
@ -168,8 +171,8 @@ register struct linked_list **ptr;
* free up an item and its thing * free up an item and its thing
*/ */
t_discard(item) void
register struct linked_list *item; t_discard(struct linked_list *item)
{ {
register struct thing *tp; register struct thing *tp;
@ -187,8 +190,8 @@ register struct linked_list *item;
* get rid of an item structure -- don't worry about contents * get rid of an item structure -- don't worry about contents
*/ */
destroy_item(item) void
register struct linked_list *item; destroy_item(struct linked_list *item)
{ {
total--; total--;
FREE(item); FREE(item);
@ -200,8 +203,7 @@ register struct linked_list *item;
*/ */
struct linked_list * struct linked_list *
new_item(size) new_item(int size)
int size;
{ {
register struct linked_list *item; register struct linked_list *item;
@ -220,7 +222,7 @@ int size;
*/ */
struct linked_list * struct linked_list *
creat_item() creat_item(void)
{ {
register struct linked_list *item; register struct linked_list *item;
@ -231,8 +233,7 @@ creat_item()
} }
char * char *
new(size) new(int size)
int size;
{ {
register char *space = ALLOC(size); register char *space = ALLOC(size);

View file

@ -27,10 +27,13 @@
#include "rogue.h" #include "rogue.h"
void open_records(void); void open_records(void);
bool too_much(void);
bool author(void);
bool playtime(void);
bool betaover(void);
main(argc, argv, envp) int
char **argv; main(int argc, char *argv[], char *envp[])
char **envp;
{ {
register char *env; register char *env;
time_t now; time_t now;
@ -283,10 +286,8 @@ char **envp;
* Exit the program abnormally. * Exit the program abnormally.
*/ */
/*UNUSED*/
void void
endit(sig) endit(int sig)
int sig;
{ {
NOOP(sig); NOOP(sig);
fatal("Ok, if you want to exit that badly, I'll have to allow it\n"); fatal("Ok, if you want to exit that badly, I'll have to allow it\n");
@ -297,8 +298,8 @@ int sig;
* Exit the program, printing a message. * Exit the program, printing a message.
*/ */
fatal(s) void
char *s; fatal(char *s)
{ {
clear(); clear();
move(lines-2, 0); move(lines-2, 0);
@ -313,8 +314,8 @@ char *s;
* Pick a very random number. * Pick a very random number.
*/ */
rnd(range) int
register int range; rnd(int range)
{ {
return( md_rand(range) ); return( md_rand(range) );
} }
@ -324,8 +325,8 @@ register int range;
* roll a number of dice * roll a number of dice
*/ */
roll(number, sides) int
register int number, sides; roll(int number, int sides)
{ {
register int dtotal = 0; register int dtotal = 0;
@ -334,7 +335,8 @@ register int number, sides;
return dtotal; return dtotal;
} }
setup() void
setup(void)
{ {
md_setup(); md_setup();
} }
@ -345,7 +347,8 @@ setup()
* refreshing things and looking at the proper times. * refreshing things and looking at the proper times.
*/ */
playit() void
playit(void)
{ {
register char *opts; register char *opts;
@ -366,7 +369,8 @@ playit()
* see if the system is being used too much for this game * see if the system is being used too much for this game
*/ */
too_much() bool
too_much(void)
{ {
/* we no longer do load checking or user counts */ /* we no longer do load checking or user counts */
return(FALSE); return(FALSE);
@ -377,7 +381,8 @@ too_much()
* See if a user is an author of the program * See if a user is an author of the program
*/ */
author() bool
author(void)
{ {
switch (md_getuid()) { switch (md_getuid()) {
case 0: /* always OK for root to play */ case 0: /* always OK for root to play */
@ -392,7 +397,8 @@ author()
* Returns TRUE when it is a good time to play rogue * Returns TRUE when it is a good time to play rogue
*/ */
playtime() bool
playtime(void)
{ {
/* we no longer do playtime checking */ /* we no longer do playtime checking */
@ -404,14 +410,15 @@ playtime()
* Returns TRUE if the test period of this version of the game is over * Returns TRUE if the test period of this version of the game is over
*/ */
betaover() bool
betaover(void)
{ {
return(FALSE); return(FALSE);
} }
exit_game(flag) void
int flag; exit_game(int flag)
{ {
int i; int i;

View file

@ -27,8 +27,11 @@ struct b_cellscells {
static char *maze_frontier, *maze_bits; static char *maze_frontier, *maze_bits;
static int maze_lines, maze_cols; static int maze_lines, maze_cols;
static char *moffset(), *foffset(); static char *moffset(int y, int x);
static int rmwall(),findcells(),crankout(),draw_maze(); static char *foffset(int y, int x);
static void rmwall(int newy, int newx, int oldy, int oldx);
static void draw_maze(void);
static int findcells(int y, int x);
/* /*
* crankout: * crankout:
@ -36,7 +39,8 @@ static int rmwall(),findcells(),crankout(),draw_maze();
*/ */
static static
crankout() void
crankout(void)
{ {
reg int x, y; reg int x, y;
@ -70,7 +74,8 @@ crankout()
* Draw the maze on this level. * Draw the maze on this level.
*/ */
do_maze() void
do_maze(void)
{ {
reg int least; reg int least;
reg struct room *rp; reg struct room *rp;
@ -94,7 +99,7 @@ do_maze()
/* /*
* add some gold to make it worth looking for * 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 = OBJPTR(item);
obj->o_count *= (rnd(50) + 50); /* add in one large hunk */ obj->o_count *= (rnd(50) + 50); /* add in one large hunk */
attach(lvl_obj, item); attach(lvl_obj, item);
@ -107,7 +112,7 @@ do_maze()
/* /*
* add in some food to make sure he has enough * 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); obj = OBJPTR(item);
attach(lvl_obj, item); attach(lvl_obj, item);
do { do {
@ -146,7 +151,8 @@ do_maze()
*/ */
static static
draw_maze() void
draw_maze(void)
{ {
reg int i, j, more; reg int i, j, more;
reg char *ptr; reg char *ptr;
@ -183,8 +189,8 @@ draw_maze()
* Figure out cells to open up * Figure out cells to open up
*/ */
static findcells(y,x) static int
reg int x, y; findcells(int y, int x)
{ {
reg int rtpos, i; reg int rtpos, i;
@ -236,8 +242,7 @@ reg int x, y;
*/ */
static char * static char *
foffset(y, x) foffset(int y, int x)
int y, x;
{ {
return (maze_frontier + (y * maze_cols) + x); return (maze_frontier + (y * maze_cols) + x);
@ -251,8 +256,7 @@ int y, x;
*/ */
bool bool
maze_view(y, x) maze_view(int y, int x)
int y, x;
{ {
register int start, goal, delta, ycheck = 0, xcheck = 0, absy, absx, see_radius; register int start, goal, delta, ycheck = 0, xcheck = 0, absy, absx, see_radius;
register bool row; register bool row;
@ -360,8 +364,7 @@ int y, x;
*/ */
static char * static char *
moffset(y, x) moffset(int y, int x)
int y, x;
{ {
return (maze_bits + (y * (cols - 1)) + x); return (maze_bits + (y * (cols - 1)) + x);
} }
@ -371,8 +374,8 @@ int y, x;
* Removes appropriate walls from the maze * Removes appropriate walls from the maze
*/ */
static static
rmwall(newy, newx, oldy, oldx) void
int newy, newx, oldy, oldx; rmwall(int newy, int newx, int oldy, int oldx)
{ {
reg int xdif,ydif; reg int xdif,ydif;

View file

@ -23,8 +23,8 @@
* Change the player's class to the specified one. * Change the player's class to the specified one.
*/ */
changeclass(newclass) void
long *newclass; changeclass(long *newclass)
{ {
if (*newclass == player.t_ctype) { if (*newclass == player.t_ctype) {
msg("You feel more skillful."); msg("You feel more skillful.");
@ -152,8 +152,8 @@ long *newclass;
* Use the relic that our monster is wielding. * Use the relic that our monster is wielding.
*/ */
m_use_relic(monster) void
register struct thing *monster; m_use_relic(struct thing *monster)
{ {
register struct object *obj; register struct object *obj;
@ -181,7 +181,7 @@ register struct thing *monster;
} }
when EMORI_CLOAK: when EMORI_CLOAK:
debug("stunning with Emori's cloak"); debug("stunning with Emori's cloak");
do_zap(monster, obj, &monster->t_newpos, WS_PARALYZE, NULL); do_zap(monster, obj, &monster->t_newpos, WS_PARALYZE, 0);
obj->o_charges = 0; obj->o_charges = 0;
when ASMO_ROD: { when ASMO_ROD: {
@ -248,11 +248,12 @@ register struct thing *monster;
/* /*
* add something to the contents of something else * add something to the contents of something else
* bag: the holder of the items
* item: the item to put inside
*/ */
put_contents(bag, item) void
register struct object *bag; /* the holder of the items */ put_contents(struct object *bag, struct linked_list *item)
register struct linked_list *item; /* the item to put inside */
{ {
register struct linked_list *titem; register struct linked_list *titem;
register struct object *tobj; register struct object *tobj;
@ -277,11 +278,11 @@ register struct linked_list *item; /* the item to put inside */
/* /*
* remove something from something else * remove something from something else
* bag: the holder of the items
*/ */
take_contents(bag, item) void
register struct object *bag; /* the holder of the items */ take_contents(struct object *bag, struct linked_list *item)
register struct linked_list *item;
{ {
if (bag->o_ac <= 0) { if (bag->o_ac <= 0) {
@ -295,8 +296,8 @@ register struct linked_list *item;
} }
do_bag(item) void
register struct linked_list *item; do_bag(struct linked_list *item)
{ {
register struct linked_list *titem = NULL; register struct linked_list *titem = NULL;
@ -417,9 +418,10 @@ register struct linked_list *item;
} }
} }
do_panic(who) void
int who; /* Kind of monster to panic (all if who is NULL) */ do_panic(int who)
{ {
/* who: kind of monster to panic (all if who is 0) */
register int x,y; register int x,y;
register struct linked_list *mon, *item; register struct linked_list *mon, *item;
register struct thing *th; register struct thing *th;
@ -485,9 +487,7 @@ int who; /* Kind of monster to panic (all if who is NULL) */
*/ */
int int
misc_name(str,obj) misc_name(char *str, struct object *obj)
char *str;
register struct object *obj;
{ {
char buf1[LINELEN]; char buf1[LINELEN];
@ -565,7 +565,8 @@ register struct object *obj;
return(0); return(0);
} }
use_emori() void
use_emori(void)
{ {
char selection; /* Cloak function */ char selection; /* Cloak function */
int state = 0; /* Menu state */ int state = 0; /* Menu state */
@ -669,8 +670,8 @@ use_emori()
* try to write a scroll with the quill of Nagrom * try to write a scroll with the quill of Nagrom
*/ */
use_quill(obj) void
struct object *obj; use_quill(struct object *obj)
{ {
struct linked_list *item; struct linked_list *item;
register int i, register int i,
@ -761,7 +762,7 @@ struct object *obj;
/* Should we overlay? */ /* Should we overlay? */
if (menu_overlay && MAXQUILL + 3 < lines - 3) { if (menu_overlay && MAXQUILL + 3 < lines - 3) {
over_win(cw, hw, MAXQUILL + 5, maxlen + 3, 0, curlen, NULL); over_win(cw, hw, MAXQUILL + 5, maxlen + 3, 0, curlen, '\0');
} }
else draw(hw); else draw(hw);
} }
@ -789,7 +790,7 @@ struct object *obj;
/* Should we overlay? */ /* Should we overlay? */
if (menu_overlay && MAXQUILL + 3 < lines - 3) { if (menu_overlay && MAXQUILL + 3 < lines - 3) {
over_win(cw, hw, MAXQUILL + 5, maxlen + 3, over_win(cw, hw, MAXQUILL + 5, maxlen + 3,
0, curlen, NULL); 0, curlen, '\0');
} }
else draw(hw); else draw(hw);
@ -830,8 +831,8 @@ struct object *obj;
* Use something * Use something
*/ */
use_mm(which) void
int which; use_mm(int which)
{ {
register struct object *obj = NULL; register struct object *obj = NULL;
register struct linked_list *item = NULL; register struct linked_list *item = NULL;
@ -907,7 +908,7 @@ int which;
when GERYON_HORN: when GERYON_HORN:
/* Chase close monsters away */ /* Chase close monsters away */
msg("The horn blasts a shrill tone."); msg("The horn blasts a shrill tone.");
do_panic(NULL); do_panic(0);
when EYE_VECNA: when EYE_VECNA:
msg("The pain slowly subsides.. "); msg("The pain slowly subsides.. ");
when HEIL_ANKH: when HEIL_ANKH:
@ -934,7 +935,7 @@ int which;
msg("The jug is empty"); msg("The jug is empty");
break; break;
} }
quaff (obj->o_ac, NULL, NULL, FALSE); quaff (obj->o_ac, 0, 0, FALSE);
obj->o_ac = JUG_EMPTY; obj->o_ac = JUG_EMPTY;
fuse (alchemy, obj, ALCHEMYTIME, AFTER); fuse (alchemy, obj, ALCHEMYTIME, AFTER);
if (!(obj->o_flags & ISKNOW)) if (!(obj->o_flags & ISKNOW))
@ -1012,7 +1013,7 @@ int which;
break; break;
} }
obj->o_charges--; obj->o_charges--;
do_panic(NULL); do_panic(0);
return; return;
/* /*
* dust of disappearance makes the player invisible for a while * dust of disappearance makes the player invisible for a while
@ -1140,7 +1141,7 @@ int which;
str = "vibrates softly"; str = "vibrates softly";
msg("You rub the crystal and it %s... ", str); msg("You rub the crystal and it %s... ", str);
/* cure him */ /* cure him */
read_scroll(S_CURING, NULL, FALSE); read_scroll(S_CURING, 0, FALSE);
/* give him weird hands */ /* give him weird hands */
turn_on(player, CANHUH); turn_on(player, CANHUH);
msg("Your fingertips turn blue. "); msg("Your fingertips turn blue. ");
@ -1218,8 +1219,7 @@ int which;
*/ */
int int
usage_time(item) usage_time(struct linked_list *item)
struct linked_list *item;
{ {
register struct object *obj; register struct object *obj;
register int units = -1; register int units = -1;

View file

@ -19,14 +19,15 @@
#include <curses.h> #include <curses.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#include "rogue.h" #include "rogue.h"
/* /*
* Check_residue takes care of any effect of the monster * Check_residue takes care of any effect of the monster
*/ */
check_residue(tp) void
register struct thing *tp; check_residue(struct thing *tp)
{ {
/* /*
* Take care of special abilities * Take care of special abilities
@ -70,13 +71,11 @@ register struct thing *tp;
/* /*
* Creat_mons creates the specified monster -- any if 0 * Creat_mons creates the specified monster -- any if 0
* person: where to create next to
*/ */
bool bool
creat_mons(person, monster, report) creat_mons(struct thing *person, short monster, bool report)
struct thing *person; /* Where to create next to */
short monster;
bool report;
{ {
struct linked_list *nitem; struct linked_list *nitem;
register struct thing *tp; register struct thing *tp;
@ -131,9 +130,7 @@ bool report;
*/ */
void void
genmonsters(least, treas) genmonsters(int least, bool treas)
register int least;
bool treas;
{ {
reg int i; reg int i;
reg struct room *rp = &rooms[0]; reg struct room *rp = &rooms[0];
@ -180,8 +177,7 @@ bool treas;
*/ */
short short
id_monst(monster) id_monst(char monster)
register char monster;
{ {
register short result; register short result;
@ -215,11 +211,8 @@ register char monster;
* Pick a new monster and add it to the list * Pick a new monster and add it to the list
*/ */
new_monster(item, type, cp, max_monster) void
struct linked_list *item; new_monster(struct linked_list *item, short type, coord *cp, bool max_monster)
short type;
coord *cp;
bool max_monster;
{ {
register struct thing *tp; register struct thing *tp;
register struct monster *mp; register struct monster *mp;
@ -428,8 +421,7 @@ bool max_monster;
*/ */
short short
randmonster(wander, no_unique) randmonster(bool wander, bool no_unique)
register bool wander, no_unique;
{ {
register int d, cur_level, range, i; register int d, cur_level, range, i;
@ -491,8 +483,8 @@ register bool wander, no_unique;
* to purchase something. * to purchase something.
*/ */
sell(tp) void
register struct thing *tp; sell(struct thing *tp)
{ {
register struct linked_list *item, *seller; register struct linked_list *item, *seller;
register struct linked_list *sellpack; register struct linked_list *sellpack;
@ -588,8 +580,7 @@ register struct thing *tp;
*/ */
struct linked_list * struct linked_list *
wake_monster(y, x) wake_monster(int y, int x)
int y, x;
{ {
register struct thing *tp; register struct thing *tp;
register struct linked_list *it; register struct linked_list *it;
@ -786,7 +777,8 @@ int y, x;
* A wandering monster has awakened and is headed for the player * A wandering monster has awakened and is headed for the player
*/ */
wanderer() void
wanderer(void)
{ {
register int i; register int i;
register struct room *hr = roomin(&hero); register struct room *hr = roomin(&hero);

View file

@ -18,6 +18,7 @@
#include <curses.h> #include <curses.h>
#include <ctype.h> #include <ctype.h>
#include <string.h>
#include "rogue.h" #include "rogue.h"
/* /*
@ -37,9 +38,8 @@ static char Moves[3][3] = {
* The guy stepped on a trap.... Make him pay. * The guy stepped on a trap.... Make him pay.
*/ */
be_trapped(th, tc) char
register struct thing *th; be_trapped(struct thing *th, coord *tc)
register coord *tc;
{ {
register struct trap *tp; register struct trap *tp;
register char ch, *mname = NULL; register char ch, *mname = NULL;
@ -504,8 +504,7 @@ register coord *tc;
*/ */
bool bool
blue_light(blessed, cursed) blue_light(bool blessed, bool cursed)
bool blessed, cursed;
{ {
register struct room *rp; register struct room *rp;
bool ret_val=FALSE; /* Whether or not affect is known */ bool ret_val=FALSE; /* Whether or not affect is known */
@ -563,8 +562,8 @@ bool blessed, cursed;
* If not, if player came from a legal place, then try to turn him. * If not, if player came from a legal place, then try to turn him.
*/ */
corr_move(dy, dx) void
int dy, dx; corr_move(int dy, int dx)
{ {
int legal=0; /* Number of legal alternatives */ int legal=0; /* Number of legal alternatives */
register int y, x, /* Indexes though possible positions */ register int y, x, /* Indexes though possible positions */
@ -642,7 +641,8 @@ int dy, dx;
* Dip an object into a magic pool * Dip an object into a magic pool
*/ */
dip_it() void
dip_it(void)
{ {
reg struct linked_list *what; reg struct linked_list *what;
reg struct object *ob; reg struct object *ob;
@ -839,8 +839,8 @@ dip_it()
* consequences (fighting, picking up, etc.) * consequences (fighting, picking up, etc.)
*/ */
do_move(dy, dx) void
int dy, dx; do_move(int dy, int dx)
{ {
register struct room *rp, *orp; register struct room *rp, *orp;
register unsigned char ch; register unsigned char ch;
@ -1189,8 +1189,8 @@ int dy, dx;
* Start the hero running * Start the hero running
*/ */
do_run(ch) void
char ch; do_run(char ch)
{ {
firstmove = TRUE; firstmove = TRUE;
running = TRUE; running = TRUE;
@ -1206,9 +1206,7 @@ char ch;
*/ */
bool bool
getdelta(match, dy, dx) getdelta(char match, int *dy, int *dx)
char match;
int *dy, *dx;
{ {
register int y, x; register int y, x;
@ -1228,8 +1226,8 @@ int *dy, *dx;
* Returns TRUE if this character is some kind of trap * Returns TRUE if this character is some kind of trap
*/ */
isatrap(ch) bool
reg char ch; isatrap(char ch)
{ {
switch(ch) { switch(ch) {
case WORMHOLE: case WORMHOLE:
@ -1250,8 +1248,8 @@ reg char ch;
* If it is dark, remove anything that might move. * If it is dark, remove anything that might move.
*/ */
light(cp) void
coord *cp; light(coord *cp)
{ {
register struct room *rp; register struct room *rp;
register int j, k, x, y; register int j, k, x, y;
@ -1428,8 +1426,7 @@ coord *cp;
*/ */
bool bool
lit_room(rp) lit_room(struct room *rp)
register struct room *rp;
{ {
register struct linked_list *fire_item; register struct linked_list *fire_item;
register struct thing *fire_creature; register struct thing *fire_creature;
@ -1466,8 +1463,7 @@ register struct room *rp;
*/ */
short short
movement(tp) movement(struct thing *tp)
register struct thing *tp;
{ {
register int result; register int result;
register int carry; /* Percentage carried */ register int carry; /* Percentage carried */
@ -1531,8 +1527,7 @@ register struct thing *tp;
*/ */
coord coord
rndmove(who) rndmove(struct thing *who)
struct thing *who;
{ {
register int x, y; register int x, y;
register int ex, ey, nopen = 0; register int ex, ey, nopen = 0;
@ -1586,9 +1581,8 @@ static const char *trap_types[TRAPTYPES] = {
* set a trap at (y, x) on screen. * set a trap at (y, x) on screen.
*/ */
set_trap(tp, y, x) void
register struct thing *tp; set_trap(struct thing *tp, int y, int x)
register int y, x;
{ {
register bool is_player = (tp == &player); register bool is_player = (tp == &player);
register int selection = rnd(TRAPTYPES-WIZARDTRAPS) + '1'; register int selection = rnd(TRAPTYPES-WIZARDTRAPS) + '1';
@ -1645,7 +1639,7 @@ register int y, x;
* Put out the selection. The longest line is * Put out the selection. The longest line is
* the prompt line (39 characters long). * the prompt line (39 characters long).
*/ */
over_win(cw, hw, num_traps + 3, 41, 0, 39, NULL); over_win(cw, hw, num_traps + 3, 41, 0, 39, '\0');
else else
draw(hw); draw(hw);
state = 1; /* Now in prompt window */ state = 1; /* Now in prompt window */
@ -1705,7 +1699,7 @@ register int y, x;
* Put out the selection. The longest line is * Put out the selection. The longest line is
* the prompt line (43 characters long). * the prompt line (43 characters long).
*/ */
over_win(cw, hw, num_traps+3, 45, 0, 43, NULL); over_win(cw, hw, num_traps+3, 45, 0, 43, '\0');
else else
draw(hw); draw(hw);
} }
@ -1778,8 +1772,8 @@ register int y, x;
* returns what a certain thing will display as to the un-initiated * returns what a certain thing will display as to the un-initiated
*/ */
show(y, x) char
register int y, x; show(int y, int x)
{ {
register unsigned char ch = winat(y, x); register unsigned char ch = winat(y, x);
register struct linked_list *it; register struct linked_list *it;
@ -1819,8 +1813,7 @@ register int y, x;
*/ */
struct trap * struct trap *
trap_at(y, x) trap_at(int y, int x)
register int y, x;
{ {
register struct trap *tp, *ep; register struct trap *tp, *ep;
@ -1838,11 +1831,12 @@ register int y, x;
* Calculate how many segments it will take to swing the given * Calculate how many segments it will take to swing the given
* weapon (note that the weapon may actually be a stick or * weapon (note that the weapon may actually be a stick or
* even something else). * even something else).
* wielder: Who's wielding the weapon
* weap: The weapon
*/ */
weap_move(wielder, weap) int
register struct thing *wielder; /* Who's wielding the weapon */ weap_move(struct thing *wielder, struct object *weap)
register struct object *weap; /* The weapon */
{ {
register int weap_rate; register int weap_rate;
int dexterity; int dexterity;

View file

@ -20,13 +20,16 @@
#include "rogue.h" #include "rogue.h"
#define TERRASAVE 3 #define TERRASAVE 3
void put_things(LEVTYPE ltype);
/* /*
* new_level: * new_level:
* Dig and draw a new level * Dig and draw a new level
* ltype: designates type of level to create
*/ */
new_level(ltype) void
LEVTYPE ltype; /* designates type of level to create */ new_level(LEVTYPE ltype)
{ {
register int rm = 0, i, cnt; register int rm = 0, i, cnt;
register unsigned char ch; register unsigned char ch;
@ -464,14 +467,15 @@ LEVTYPE ltype; /* designates type of level to create */
/* Do we sense any food on this level? */ /* Do we sense any food on this level? */
if (cur_relic[SURTUR_RING]) if (cur_relic[SURTUR_RING])
quaff(P_FFIND, NULL, NULL, FALSE); quaff(P_FFIND, 0, 0, FALSE);
} }
/* /*
* Pick a room that is really there * Pick a room that is really there
*/ */
rnd_room() int
rnd_room(void)
{ {
register int rm; register int rm;
@ -487,10 +491,11 @@ rnd_room()
/* /*
* put_things: * put_things:
* put potions and scrolls on this level * put potions and scrolls on this level
* ltype: designates type of level to create
*/ */
put_things(ltype) void
LEVTYPE ltype; /* designates type of level to create */ put_things(LEVTYPE ltype)
{ {
register int i, rm, cnt; register int i, rm, cnt;
register struct object *cur; register struct object *cur;

View file

@ -30,6 +30,6 @@ struct network {
char *rogue; char *rogue;
}; };
extern struct network Network[]; extern struct network Network[];
extern unsigned long netread(); extern unsigned long netread(int *error, int size, FILE *stream);
extern unsigned long netwrite(); extern int netwrite(unsigned long value, int size, FILE *stream);

View file

@ -41,16 +41,16 @@ struct optstruct {
typedef struct optstruct OPTION; typedef struct optstruct OPTION;
int put_bool(), int get_ro(WINDOW *win, int oy, int ox);
get_bool(), void put_bool(bool *b, WINDOW *win);
put_str(), int get_bool(bool *bp, WINDOW *win);
get_str(), void put_str(char *str, WINDOW *win);
put_abil(), int get_str(char *opt, WINDOW *win);
get_abil(), void put_abil(int *ability, WINDOW *win);
get_quest(), void get_abil(int *abil, WINDOW *win);
put_quest(), void put_quest(int *quest, WINDOW *win);
get_default(); void get_quest(int *quest, WINDOW *win);
void get_default(bool *bp, WINDOW *win);
int get_str_prot(char *opt, WINDOW *win); int get_str_prot(char *opt, WINDOW *win);
int get_score(char *opt, WINDOW *win); int get_score(char *opt, WINDOW *win);
bool allowchange(OPTION *op); bool allowchange(OPTION *op);
@ -88,9 +88,8 @@ OPTION optlist[] = {
* The default attribute field is read-only * The default attribute field is read-only
*/ */
get_default(bp, win) void
bool *bp; get_default(bool *bp, WINDOW *win)
WINDOW *win;
{ {
register int oy, ox; register int oy, ox;
@ -103,9 +102,8 @@ WINDOW *win;
* The ability (class) field is read-only * The ability (class) field is read-only
*/ */
get_abil(abil, win) void
int *abil; get_abil(int *abil, WINDOW *win)
WINDOW *win;
{ {
register int oy, ox; register int oy, ox;
@ -118,9 +116,8 @@ WINDOW *win;
* The quest field is read-only * The quest field is read-only
*/ */
get_quest(quest, win) void
int *quest; get_quest(int *quest, WINDOW *win)
WINDOW *win;
{ {
register int oy, ox; register int oy, ox;
@ -134,9 +131,8 @@ WINDOW *win;
* "Get" a read-only value. * "Get" a read-only value.
*/ */
get_ro(win, oy, ox) int
WINDOW *win; get_ro(WINDOW *win, int oy, int ox)
register int oy, ox;
{ {
register int ny, nx; register int ny, nx;
register bool op_bad; register bool op_bad;
@ -173,9 +169,8 @@ register int oy, ox;
* allow changing a boolean option and print it out * allow changing a boolean option and print it out
*/ */
get_bool(bp, win) int
bool *bp; get_bool(bool *bp, WINDOW *win)
WINDOW *win;
{ {
register int oy, ox; register int oy, ox;
register bool op_bad; register bool op_bad;
@ -223,9 +218,8 @@ WINDOW *win;
* set a string option * set a string option
*/ */
get_str(opt, win) int
register char *opt; get_str(char *opt, WINDOW *win)
WINDOW *win;
{ {
register char *sp; register char *sp;
register int c, oy, ox; register int c, oy, ox;
@ -298,7 +292,8 @@ WINDOW *win;
* print and then set options from the terminal * print and then set options from the terminal
*/ */
option() void
option(void)
{ {
register OPTION *op; register OPTION *op;
register int retval; register int retval;
@ -356,8 +351,8 @@ option()
* or the end of the entire option string. * or the end of the entire option string.
*/ */
parse_opts(str) void
register char *str; parse_opts(char *str)
{ {
register char *sp; register char *sp;
register OPTION *op; register OPTION *op;
@ -466,9 +461,8 @@ register char *str;
* print the character type * print the character type
*/ */
put_abil(ability, win) void
int *ability; put_abil(int *ability, WINDOW *win)
WINDOW *win;
{ {
waddstr(win, char_class[*ability].name); waddstr(win, char_class[*ability].name);
} }
@ -477,9 +471,8 @@ WINDOW *win;
* print out the quest * print out the quest
*/ */
put_quest(quest, win) void
int *quest; put_quest(int *quest, WINDOW *win)
WINDOW *win;
{ {
waddstr(win, rel_magic[*quest].mi_name); waddstr(win, rel_magic[*quest].mi_name);
} }
@ -488,9 +481,8 @@ WINDOW *win;
* put out a boolean * put out a boolean
*/ */
put_bool(b, win) void
bool *b; put_bool(bool *b, WINDOW *win)
WINDOW *win;
{ {
waddstr(win, *b ? "True" : "False"); waddstr(win, *b ? "True" : "False");
} }
@ -499,9 +491,8 @@ WINDOW *win;
* put out a string * put out a string
*/ */
put_str(str, win) void
char *str; put_str(char *str, WINDOW *win)
WINDOW *win;
{ {
waddstr(win, str); waddstr(win, str);
} }

View file

@ -15,7 +15,8 @@
#include <curses.h> #include <curses.h>
#include "rogue.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: * init_terrain:
@ -23,7 +24,7 @@ extern char rnd_terrain(), get_terrain();
*/ */
void void
init_terrain() init_terrain(void)
{ {
register struct room *rp; register struct room *rp;
@ -40,9 +41,7 @@ init_terrain()
} }
void void
do_terrain(basey, basex, deltay, deltax, fresh) do_terrain(int basey, int basex, int deltay, int deltax, bool fresh)
int basey, basex, deltay, deltax;
bool fresh;
{ {
register int cury, curx; /* Current y and x positions */ register int cury, curx; /* Current y and x positions */
@ -140,7 +139,7 @@ bool fresh;
*/ */
char char
rnd_terrain() rnd_terrain(void)
{ {
int chance = rnd(100); int chance = rnd(100);
@ -164,8 +163,7 @@ rnd_terrain()
*/ */
char char
get_terrain(one, two, three, four) get_terrain(char one, char two, char three, char four)
char one, two, three, four;
{ {
register int i; register int i;
int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0; int forest = 0, mountain = 0, lake = 0, meadow = 0, total = 0;

View file

@ -21,6 +21,8 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
bool is_type(struct object *obj, int type);
/* /*
* add_pack: * add_pack:
* Pick up an object and add it to the pack. If the argument is non-null * Pick up an object and add it to the pack. If the argument is non-null
@ -28,9 +30,7 @@
*/ */
bool bool
add_pack(item, silent) add_pack(struct linked_list *item, bool silent)
register struct linked_list *item;
bool silent;
{ {
register struct linked_list *ip, *lp = NULL, *ap; register struct linked_list *ip, *lp = NULL, *ap;
register struct object *obj, *op = NULL; register struct object *obj, *op = NULL;
@ -462,9 +462,8 @@ picked_up:
* list what is in the pack * list what is in the pack
*/ */
inventory(list, type) bool
register struct linked_list *list; inventory(struct linked_list *list, int type)
register int type;
{ {
register struct object *obj; register struct object *obj;
register char ch; register char ch;
@ -563,7 +562,7 @@ register int type;
*/ */
void void
picky_inven() picky_inven(void)
{ {
register struct linked_list *item; register struct linked_list *item;
register char ch, mch; register char ch, mch;
@ -616,14 +615,12 @@ picky_inven()
/* /*
* get_item: * get_item:
* pick something out of a pack for a purpose * pick something out of a pack for a purpose
* purpose: NULL if we should be silent (no prompts)
*/ */
struct linked_list * struct linked_list *
get_item(list, purpose, type, askfirst, showcost) get_item(struct linked_list *list, char *purpose, int type, bool askfirst,
reg struct linked_list *list; bool showcost)
char *purpose; /* NULL if we should be silent (no prompts) */
int type;
bool askfirst, showcost;
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -755,7 +752,7 @@ bool askfirst, showcost;
/* Write the screen */ /* Write the screen */
if ((menu_overlay && cnt < lines - 3) || cnt == 1) { if ((menu_overlay && cnt < lines - 3) || cnt == 1) {
over_win(cw, hw, cnt + 2, maxx + 3, cnt, curx, NULL); over_win(cw, hw, cnt + 2, maxx + 3, cnt, curx, '\0');
cnt = -1; /* Indicate we used over_win */ cnt = -1; /* Indicate we used over_win */
} }
else draw(hw); else draw(hw);
@ -814,9 +811,8 @@ bool askfirst, showcost;
} }
} }
pack_char(list, obj) char
register struct object *obj; pack_char(struct linked_list *list, struct object *obj)
struct linked_list *list;
{ {
register struct linked_list *item; register struct linked_list *item;
register char c; register char c;
@ -838,8 +834,8 @@ struct linked_list *list;
* This updates cur_weapon etc for dropping things * This updates cur_weapon etc for dropping things
*/ */
cur_null(op) void
reg struct object *op; cur_null(struct object *op)
{ {
if (op == cur_weapon) cur_weapon = NULL; if (op == cur_weapon) cur_weapon = NULL;
else if (op == cur_armor) cur_armor = NULL; else if (op == cur_armor) cur_armor = NULL;
@ -864,7 +860,8 @@ reg struct object *op;
* Identify all the items in the pack * Identify all the items in the pack
*/ */
idenpack() void
idenpack(void)
{ {
reg struct linked_list *pc; reg struct linked_list *pc;
@ -872,9 +869,8 @@ idenpack()
whatis(pc); whatis(pc);
} }
is_type (obj, type) bool
register struct object *obj; is_type(struct object *obj, int type)
register int type;
{ {
register bool current; register bool current;
@ -1029,8 +1025,8 @@ register int type;
return(FALSE); return(FALSE);
} }
del_pack(item) void
register struct linked_list *item; del_pack(struct linked_list *item)
{ {
register struct object *obj; register struct object *obj;
@ -1052,9 +1048,8 @@ register struct linked_list *item;
* it to him. * it to him.
*/ */
carry_obj(mp, chance) void
register struct thing *mp; carry_obj(struct thing *mp, int chance)
int chance;
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -1077,75 +1072,75 @@ int chance;
*/ */
if (on(*mp, ISUNIQUE)) { if (on(*mp, ISUNIQUE)) {
if (on(*mp, CARRYMDAGGER)) { if (on(*mp, CARRYMDAGGER)) {
item = spec_item(RELIC, MUSTY_DAGGER, NULL, NULL); item = spec_item(RELIC, MUSTY_DAGGER, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYCLOAK)) { if (on(*mp, CARRYCLOAK)) {
item = spec_item(RELIC, EMORI_CLOAK, NULL, NULL); item = spec_item(RELIC, EMORI_CLOAK, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYANKH)) { if (on(*mp, CARRYANKH)) {
item = spec_item(RELIC, HEIL_ANKH, NULL, NULL); item = spec_item(RELIC, HEIL_ANKH, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYSTAFF)) { if (on(*mp, CARRYSTAFF)) {
item = spec_item(RELIC, MING_STAFF, NULL, NULL); item = spec_item(RELIC, MING_STAFF, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYWAND)) { if (on(*mp, CARRYWAND)) {
item = spec_item(RELIC, ORCUS_WAND, NULL, NULL); item = spec_item(RELIC, ORCUS_WAND, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYROD)) { if (on(*mp, CARRYROD)) {
item = spec_item(RELIC, ASMO_ROD, NULL, NULL); item = spec_item(RELIC, ASMO_ROD, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYYAMULET)) { if (on(*mp, CARRYYAMULET)) {
item = spec_item(RELIC, YENDOR_AMULET, NULL, NULL); item = spec_item(RELIC, YENDOR_AMULET, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYBAMULET)) { if (on(*mp, CARRYBAMULET)) {
item = spec_item(RELIC, STONEBONES_AMULET, NULL, NULL); item = spec_item(RELIC, STONEBONES_AMULET, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYMANDOLIN)) { if (on(*mp, CARRYMANDOLIN)) {
item = spec_item(RELIC, BRIAN_MANDOLIN, NULL, NULL); item = spec_item(RELIC, BRIAN_MANDOLIN, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYEYE)) { if (on(*mp, CARRYEYE)) {
item = spec_item(RELIC, EYE_VECNA, NULL, NULL); item = spec_item(RELIC, EYE_VECNA, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYAXE)) { if (on(*mp, CARRYAXE)) {
item = spec_item(RELIC, AXE_AKLAD, NULL, NULL); item = spec_item(RELIC, AXE_AKLAD, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
@ -1153,7 +1148,7 @@ int chance;
if (on(*mp, CARRYQUILL)) { if (on(*mp, CARRYQUILL)) {
register int i, howmany; register int i, howmany;
item = spec_item(RELIC, QUILL_NAGROM, NULL, NULL); item = spec_item(RELIC, QUILL_NAGROM, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
obj->o_charges = rnd(QUILLCHARGES); obj->o_charges = rnd(QUILLCHARGES);
@ -1170,31 +1165,31 @@ int chance;
} }
} }
if (on(*mp, CARRYMSTAR)) { if (on(*mp, CARRYMSTAR)) {
item = spec_item(RELIC, HRUGGEK_MSTAR, NULL, NULL); item = spec_item(RELIC, HRUGGEK_MSTAR, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYFLAIL)) { if (on(*mp, CARRYFLAIL)) {
item = spec_item(RELIC, YEENOGHU_FLAIL, NULL, NULL); item = spec_item(RELIC, YEENOGHU_FLAIL, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYHORN)) { if (on(*mp, CARRYHORN)) {
item = spec_item(RELIC, GERYON_HORN, NULL, NULL); item = spec_item(RELIC, GERYON_HORN, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYSURTURRING)) { if (on(*mp, CARRYSURTURRING)) {
item = spec_item(RELIC, SURTUR_RING, NULL, NULL); item = spec_item(RELIC, SURTUR_RING, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
} }
if (on(*mp, CARRYCARD)) { if (on(*mp, CARRYCARD)) {
item = spec_item(RELIC, ALTERAN_CARD, NULL, NULL); item = spec_item(RELIC, ALTERAN_CARD, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
attach(mp->t_pack, item); attach(mp->t_pack, item);
@ -1204,7 +1199,7 @@ int chance;
* If it carries gold, give it some * If it carries gold, give it some
*/ */
if (on(*mp, CARRYGOLD) && rnd(100) < chance) { 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 = OBJPTR(item);
obj->o_count = GOLDCALC + GOLDCALC; obj->o_count = GOLDCALC + GOLDCALC;
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
@ -1232,7 +1227,7 @@ int chance;
when 40: type = E_SLIMEMOLD; /* monster food */ when 40: type = E_SLIMEMOLD; /* monster food */
otherwise: type = E_RATION; otherwise: type = E_RATION;
} }
item = spec_item(FOOD, type, NULL, NULL); item = spec_item(FOOD, type, 0, 0);
obj = OBJPTR(item); obj = OBJPTR(item);
obj->o_weight = things[TYP_FOOD].mi_wght; obj->o_weight = things[TYP_FOOD].mi_wght;
obj->o_pos = mp->t_pos; obj->o_pos = mp->t_pos;
@ -1356,8 +1351,8 @@ int chance;
* he wants (* means everything). * he wants (* means everything).
*/ */
grab(y, x) int
register int y, x; grab(int y, int x)
{ {
register struct linked_list *next_item, *item; register struct linked_list *next_item, *item;
register struct object *obj; register struct object *obj;
@ -1425,7 +1420,7 @@ register int y, x;
* Leave 3 blank lines at the bottom and 3 blank columns to he right. * Leave 3 blank lines at the bottom and 3 blank columns to he right.
*/ */
if (menu_overlay && num_there < lines - 3) { if (menu_overlay && num_there < lines - 3) {
over_win(cw, hw, num_there + 2, maxlen + 3, num_there, curlen, NULL); over_win(cw, hw, num_there + 2, maxlen + 3, num_there, curlen, '\0');
pagecnt = -1; /* Indicate we used over_win */ pagecnt = -1; /* Indicate we used over_win */
} }
else draw(hw); /* write screen */ else draw(hw); /* write screen */
@ -1474,7 +1469,7 @@ register int y, x;
*/ */
if (menu_overlay && num_there < lines - 3) { if (menu_overlay && num_there < lines - 3) {
over_win(cw, hw, num_there + 2, maxlen + 3, over_win(cw, hw, num_there + 2, maxlen + 3,
num_there, 49, NULL); num_there, 49, '\0');
cnt = -1; /* Indicate we used over_win */ cnt = -1; /* Indicate we used over_win */
} }
else draw(hw); /* write screen */ else draw(hw); /* write screen */
@ -1513,8 +1508,8 @@ register int y, x;
* Create a pack for sellers (a la quartermaster) * Create a pack for sellers (a la quartermaster)
*/ */
make_sell_pack(tp) void
struct thing *tp; make_sell_pack(struct thing *tp)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;

View file

@ -16,15 +16,20 @@
See the file LICENSE.TXT for full copyright and licensing information. See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <stdlib.h>
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
void conn(int r1, int r2);
void door(struct room *rm, coord *cp);
/* /*
* do_passages: * do_passages:
* Draw all the passages on a level. * Draw all the passages on a level.
*/ */
do_passages() void
do_passages(void)
{ {
register struct rdes *r1, *r2 = NULL; register struct rdes *r1, *r2 = NULL;
register int i, j; register int i, j;
@ -133,8 +138,8 @@ do_passages()
* Draw a corridor from a room in a certain direction. * Draw a corridor from a room in a certain direction.
*/ */
conn(r1, r2) void
int r1, r2; conn(int r1, int r2)
{ {
register struct room *rpf, *rpt = NULL; register struct room *rpf, *rpt = NULL;
register char rmt; register char rmt;
@ -347,9 +352,8 @@ int r1, r2;
* also enters the door in the exits array of the room. * also enters the door in the exits array of the room.
*/ */
door(rm, cp) void
register struct room *rm; door(struct room *rm, coord *cp)
register coord *cp;
{ {
struct linked_list *newroom; struct linked_list *newroom;
coord *exit; coord *exit;

View file

@ -17,12 +17,15 @@
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
bool pick_spell(struct spells spells[], int ability, int num_spells, int power,
const char *prompt, const char *type);
/* /*
* affect: * affect:
* cleric affecting undead * cleric affecting undead
*/ */
affect() void
affect(void)
{ {
register struct linked_list *item; register struct linked_list *item;
register struct thing *tp; register struct thing *tp;
@ -140,7 +143,8 @@ annoy:
* the cleric asks his deity for a spell * the cleric asks his deity for a spell
*/ */
pray() void
pray(void)
{ {
register int num_prayers, prayer_ability, which_prayer; register int num_prayers, prayer_ability, which_prayer;
@ -210,7 +214,7 @@ pray()
if (cleric_spells[which_prayer].s_type == TYP_POTION) if (cleric_spells[which_prayer].s_type == TYP_POTION)
quaff( cleric_spells[which_prayer].s_which, quaff( cleric_spells[which_prayer].s_which,
NULL, 0,
cleric_spells[which_prayer].s_flag, cleric_spells[which_prayer].s_flag,
FALSE); FALSE);
else if (cleric_spells[which_prayer].s_type == TYP_SCROLL) else if (cleric_spells[which_prayer].s_type == TYP_SCROLL)
@ -231,7 +235,8 @@ pray()
* the magician is going to try and cast a spell * the magician is going to try and cast a spell
*/ */
cast() void
cast(void)
{ {
register int spell_ability, which_spell, num_spells; register int spell_ability, which_spell, num_spells;
@ -291,7 +296,7 @@ cast()
if (magic_spells[which_spell].s_type == TYP_POTION) if (magic_spells[which_spell].s_type == TYP_POTION)
quaff( magic_spells[which_spell].s_which, quaff( magic_spells[which_spell].s_which,
NULL, 0,
magic_spells[which_spell].s_flag, magic_spells[which_spell].s_flag,
FALSE); FALSE);
else if (magic_spells[which_spell].s_type == TYP_SCROLL) else if (magic_spells[which_spell].s_type == TYP_SCROLL)
@ -312,7 +317,8 @@ cast()
* the druid asks his deity for a spell * the druid asks his deity for a spell
*/ */
chant() void
chant(void)
{ {
register int num_chants, chant_ability, which_chant; register int num_chants, chant_ability, which_chant;
@ -377,7 +383,7 @@ chant()
if (druid_spells[which_chant].s_type == TYP_POTION) if (druid_spells[which_chant].s_type == TYP_POTION)
quaff( druid_spells[which_chant].s_which, quaff( druid_spells[which_chant].s_which,
NULL, 0,
druid_spells[which_chant].s_flag, druid_spells[which_chant].s_flag,
FALSE); FALSE);
else if (druid_spells[which_chant].s_type == TYP_SCROLL) else if (druid_spells[which_chant].s_type == TYP_SCROLL)
@ -396,7 +402,8 @@ chant()
/* Constitution bonus */ /* Constitution bonus */
const_bonus() /* Hit point adjustment for changing levels */ int
const_bonus(void) /* Hit point adjustment for changing levels */
{ {
register int bonus; register int bonus;
if (pstats.s_const > 9 && pstats.s_const < 18) if (pstats.s_const > 9 && pstats.s_const < 18)
@ -436,8 +443,8 @@ const_bonus() /* Hit point adjustment for changing levels */
* way to get this artifact and remain alive. * way to get this artifact and remain alive.
*/ */
give(th) void
register struct thing *th; give(struct thing *th)
{ {
/* /*
* Find any monster within one space of you * Find any monster within one space of you
@ -571,8 +578,8 @@ register struct thing *th;
* Frighten a monster. Useful for the 'good' characters. * Frighten a monster. Useful for the 'good' characters.
*/ */
fright(th) void
register struct thing *th; fright(struct thing *th)
{ {
/* /*
* Find any monster within one space of you * Find any monster within one space of you
@ -682,13 +689,14 @@ register struct thing *th;
* gsense: Sense gold * gsense: Sense gold
*/ */
gsense() void
gsense(void)
{ {
/* Thief & assassin can do this, but fighter & ranger can later */ /* Thief & assassin can do this, but fighter & ranger can later */
if (player.t_ctype == C_THIEF || player.t_ctype == C_ASSASSIN || if (player.t_ctype == C_THIEF || player.t_ctype == C_ASSASSIN ||
((player.t_ctype == C_FIGHTER || player.t_ctype == C_RANGER) && ((player.t_ctype == C_FIGHTER || player.t_ctype == C_RANGER) &&
pstats.s_lvl >= 12)) { pstats.s_lvl >= 12)) {
read_scroll(S_GFIND, NULL, FALSE); read_scroll(S_GFIND, 0, FALSE);
} }
else msg("You seem to have no gold sense."); else msg("You seem to have no gold sense.");
return; return;
@ -698,13 +706,14 @@ gsense()
* xsense: Sense traps * xsense: Sense traps
*/ */
xsense() void
xsense(void)
{ {
/* Only thief can do this, but assassin, fighter, & monk can later */ /* Only thief can do this, but assassin, fighter, & monk can later */
if (player.t_ctype == C_THIEF || ((player.t_ctype == C_ASSASSIN || if (player.t_ctype == C_THIEF || ((player.t_ctype == C_ASSASSIN ||
player.t_ctype == C_FIGHTER || player.t_ctype == C_MONK) && player.t_ctype == C_FIGHTER || player.t_ctype == C_MONK) &&
pstats.s_lvl >= 14)) { pstats.s_lvl >= 14)) {
read_scroll(S_FINDTRAPS, NULL, FALSE); read_scroll(S_FINDTRAPS, 0, FALSE);
} }
else msg("You seem not to be able to sense traps."); else msg("You seem not to be able to sense traps.");
return; return;
@ -715,7 +724,8 @@ xsense()
* Steal in direction given in delta * Steal in direction given in delta
*/ */
steal() void
steal(void)
{ {
register struct linked_list *item; register struct linked_list *item;
register struct thing *tp; register struct thing *tp;
@ -857,7 +867,8 @@ steal()
* Take charmed monsters with you via up or down commands. * Take charmed monsters with you via up or down commands.
*/ */
take_with() void
take_with(void)
{ {
register struct thing *tp; register struct thing *tp;
register struct linked_list *item; register struct linked_list *item;
@ -884,15 +895,17 @@ take_with()
/* /*
* this routine lets the player pick the spell that they * this routine lets the player pick the spell that they
* want to cast regardless of character class * want to cast regardless of character class
* spells: spell list
* ability: spell ability
* num_spells: number of spells that can be cast
* power: spell power
* prompt: prompt for spell list
* type: type of thing--> spell, prayer, chant
*/ */
pick_spell(spells, ability, num_spells, power, prompt, type) bool
struct spells spells[]; /* spell list */ pick_spell(struct spells spells[], int ability, int num_spells, int power,
int ability; /* spell ability */ const char *prompt, const char *type)
int num_spells; /* number of spells that can be cast */
int power; /* spell power */
const char *prompt; /* prompt for spell list */
const char *type; /* type of thing--> spell, prayer, chant */
{ {
bool nohw = FALSE; bool nohw = FALSE;
register int i; register int i;
@ -1001,7 +1014,7 @@ const char *type; /* type of thing--> spell, prayer, chant */
/* Should we overlay? */ /* Should we overlay? */
if (menu_overlay && num_spells + 3 < lines - 3) { if (menu_overlay && num_spells + 3 < lines - 3) {
over_win(cw, hw, num_spells + 5, maxlen + 3, 0, curlen, NULL); over_win(cw, hw, num_spells + 5, maxlen + 3, 0, curlen, '\0');
} }
else draw(hw); else draw(hw);
} }
@ -1029,7 +1042,7 @@ const char *type; /* type of thing--> spell, prayer, chant */
/* Should we overlay? */ /* Should we overlay? */
if (menu_overlay && num_spells + 3 < lines - 3) { if (menu_overlay && num_spells + 3 < lines - 3) {
over_win(cw, hw, num_spells + 5, maxlen + 3, over_win(cw, hw, num_spells + 5, maxlen + 3,
0, curlen, NULL); 0, curlen, '\0');
} }
else draw(hw); else draw(hw);
@ -1068,7 +1081,8 @@ const char *type; /* type of thing--> spell, prayer, chant */
* Let the player know what's happening with himself * Let the player know what's happening with himself
*/ */
opt_player() void
opt_player(void)
{ {
int i = 1; /* initialize counters */ int i = 1; /* initialize counters */
int j = 2; int j = 2;
@ -1446,7 +1460,7 @@ opt_player()
if (menu_overlay) { /* Print the list. */ if (menu_overlay) { /* Print the list. */
wmove(hw, i+2, 0); wmove(hw, i+2, 0);
wprintw(hw, spacemsg); wprintw(hw, spacemsg);
over_win(cw, hw, i+3, j, i+2, 27, NULL); over_win(cw, hw, i+3, j, i+2, 27, '\0');
} }
else { else {
wmove(hw, i+2, 0); wmove(hw, i+2, 0);
@ -1461,7 +1475,7 @@ opt_player()
wprintw(hw, spacemsg); wprintw(hw, spacemsg);
if (j > 2) j = 78; if (j > 2) j = 78;
else j = 39; else j = 39;
over_win(cw, hw, i+3, j, i+2, 27, NULL); over_win(cw, hw, i+3, j, i+2, 27, '\0');
} }
else { else {
wmove(hw, i+2, 0); wmove(hw, i+2, 0);

View file

@ -20,6 +20,19 @@
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
int add_charisma(int change);
int add_constitution(int change);
int add_dexterity(int change);
int add_intelligence(int change);
int add_strength(int change);
int add_wisdom(int change);
int res_charisma(int howmuch);
int res_constitution(int howmuch);
int res_dexterity(int howmuch);
int res_intelligence(int howmuch);
int res_wisdom(int howmuch);
/* /*
* add_abil is an array of functions used to change attributes. It must be * add_abil is an array of functions used to change attributes. It must be
* ordered according to the attribute definitions in rogue.h. * ordered according to the attribute definitions in rogue.h.
@ -45,8 +58,7 @@ int (*res_abil[NUMABILITIES])() = {
*/ */
int int
add_constitution(change) add_constitution(int change)
int change;
{ {
/* Do the potion */ /* Do the potion */
if (change < 0) { if (change < 0) {
@ -76,8 +88,7 @@ int change;
*/ */
int int
add_charisma(change) add_charisma(int change)
int change;
{ {
/* Do the potion */ /* Do the potion */
if (change < 0) msg("You feel less attractive now."); if (change < 0) msg("You feel less attractive now.");
@ -99,8 +110,7 @@ int change;
*/ */
int int
add_dexterity(change) add_dexterity(int change)
int change;
{ {
int ring_str; /* Value of ring strengths */ int ring_str; /* Value of ring strengths */
@ -132,8 +142,8 @@ int change;
* add a haste to the player * add a haste to the player
*/ */
add_haste(blessed) void
bool blessed; add_haste(bool blessed)
{ {
int hasttime; int hasttime;
@ -171,8 +181,7 @@ bool blessed;
*/ */
int int
add_intelligence(change) add_intelligence(int change)
int change;
{ {
int ring_str; /* Value of ring strengths */ int ring_str; /* Value of ring strengths */
@ -203,7 +212,8 @@ int change;
* this routine makes the hero move slower * this routine makes the hero move slower
*/ */
add_slow() void
add_slow(void)
{ {
/* monks cannot be slowed or hasted */ /* monks cannot be slowed or hasted */
if (player.t_ctype == C_MONK || ISWEARING(R_FREEDOM)) { if (player.t_ctype == C_MONK || ISWEARING(R_FREEDOM)) {
@ -232,8 +242,7 @@ add_slow()
*/ */
int int
add_strength(change) add_strength(int change)
int change;
{ {
if (change < 0) { if (change < 0) {
@ -252,8 +261,7 @@ int change;
*/ */
int int
add_wisdom(change) add_wisdom(int change)
int change;
{ {
int ring_str; /* Value of ring strengths */ int ring_str; /* Value of ring strengths */
@ -280,11 +288,8 @@ int change;
return(0); return(0);
} }
quaff(which, kind, flags, is_potion) void
int which; quaff(int which, int kind, int flags, bool is_potion)
int kind;
int flags;
bool is_potion;
{ {
register struct object *obj; register struct object *obj;
register struct linked_list *item, *titem; register struct linked_list *item, *titem;
@ -587,7 +592,7 @@ bool is_potion;
blessed ? "much " : ""); blessed ? "much " : "");
p_know[P_RAISE] = TRUE; p_know[P_RAISE] = TRUE;
raise_level(); raise_level();
do_panic(NULL); /* this startles them */ do_panic(0); /* this startles them */
if (blessed) raise_level(); if (blessed) raise_level();
} }
when P_HASTE: when P_HASTE:
@ -941,8 +946,7 @@ bool is_potion;
*/ */
int int
res_dexterity(howmuch) res_dexterity(int howmuch)
int howmuch;
{ {
short save_max; short save_max;
int ring_str; int ring_str;
@ -975,8 +979,7 @@ int howmuch;
*/ */
int int
res_intelligence(howmuch) res_intelligence(int howmuch)
int howmuch;
{ {
short save_max; short save_max;
int ring_str; int ring_str;
@ -1004,8 +1007,7 @@ int howmuch;
*/ */
int int
res_wisdom(howmuch) res_wisdom(int howmuch)
int howmuch;
{ {
short save_max; short save_max;
int ring_str; int ring_str;
@ -1033,8 +1035,7 @@ int howmuch;
*/ */
int int
res_constitution(howmuch) res_constitution(int howmuch)
int howmuch;
{ {
if (howmuch > 0) if (howmuch > 0)
pstats.s_const = min(pstats.s_const + howmuch, max_stats.s_const); pstats.s_const = min(pstats.s_const + howmuch, max_stats.s_const);
@ -1048,8 +1049,7 @@ int howmuch;
*/ */
int int
res_charisma(howmuch) res_charisma(int howmuch)
int howmuch;
{ {
if (howmuch > 0) if (howmuch > 0)
pstats.s_charisma = pstats.s_charisma =

View file

@ -29,8 +29,8 @@
* how much food does this ring use up? * how much food does this ring use up?
*/ */
ring_eat(hand) int
register int hand; ring_eat(int hand)
{ {
if (cur_ring[hand] == NULL) if (cur_ring[hand] == NULL)
return 0; return 0;
@ -54,8 +54,8 @@ register int hand;
return 0; return 0;
} }
ring_on(item) void
register struct linked_list *item; ring_on(struct linked_list *item)
{ {
register struct object *obj; register struct object *obj;
register int save_max; register int save_max;
@ -122,8 +122,7 @@ register struct linked_list *item;
*/ */
char * char *
ring_num(obj) ring_num(struct object *obj)
register struct object *obj;
{ {
static char buf[5]; static char buf[5];
@ -158,7 +157,8 @@ register struct object *obj;
* Return the effect of the specified ring * Return the effect of the specified ring
*/ */
ring_value(type) int
ring_value(int type)
{ {
int result = 0; int result = 0;

View file

@ -20,6 +20,7 @@
#define EDITSCORE 2 /* Edit the current score file */ #define EDITSCORE 2 /* Edit the current score file */
#define ADDSCORE 3 /* Add a new score */ #define ADDSCORE 3 /* Add a new score */
#include <stdlib.h>
#include <curses.h> #include <curses.h>
#include <time.h> #include <time.h>
#include <signal.h> #include <signal.h>
@ -54,14 +55,20 @@ static char *rip[] = {
NULL NULL
}; };
char *killname(); int rs_read_scorefile(FILE *savef, struct sc_ent *entries, int count);
void rs_write_scorefile(FILE *savef, struct sc_ent *entries, int count);
char *killname(short monst);
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);
extern FILE *scorefi, *logfile; extern FILE *scorefi, *logfile;
/*UNUSED*/ /*UNUSED*/
void void
byebye(sig) byebye(int sig)
int sig;
{ {
NOOP(sig); NOOP(sig);
exit_game(EXIT_ENDWIN); exit_game(EXIT_ENDWIN);
@ -73,8 +80,8 @@ int sig;
* Do something really fun when he dies * Do something really fun when he dies
*/ */
death(monst) void
register short monst; death(short monst)
{ {
register char **dp = rip, *killer; register char **dp = rip, *killer;
register struct tm *lt; register struct tm *lt;
@ -102,8 +109,7 @@ register short monst;
} }
char * char *
killname(monst) killname(short monst)
register short monst;
{ {
static char mons_name[LINELEN/2]; static char mons_name[LINELEN/2];
int i; int i;
@ -187,10 +193,8 @@ writelog(unsigned long amount, int flags, short monst)
*/ */
/* VARARGS2 */ /* VARARGS2 */
score(amount, flags, monst) void
unsigned long amount; score(unsigned long amount, int flags, short monst)
int flags;
short monst;
{ {
struct sc_ent top_ten[NUMSCORE]; struct sc_ent top_ten[NUMSCORE];
register struct sc_ent *scp; register struct sc_ent *scp;
@ -574,8 +578,8 @@ short monst;
* Display the contents of the hero's pack * Display the contents of the hero's pack
*/ */
showpack(howso) void
char *howso; showpack(char *howso)
{ {
reg char *iname; reg char *iname;
reg int cnt, packnum; reg int cnt, packnum;
@ -604,7 +608,8 @@ char *howso;
refresh(); refresh();
} }
total_winner() void
total_winner(void)
{ {
register struct linked_list *item; register struct linked_list *item;
register struct object *obj; register struct object *obj;
@ -665,9 +670,7 @@ total_winner()
void void
delete_score(top_ten, idx) delete_score(struct sc_ent top_ten[NUMSCORE], int idx)
struct sc_ent top_ten[NUMSCORE];
int idx;
{ {
for(;idx < NUMSCORE-1;idx++) for(;idx < NUMSCORE-1;idx++)
top_ten[idx] = top_ten[idx+1]; top_ten[idx] = top_ten[idx+1];
@ -676,9 +679,7 @@ int idx;
} }
int int
insert_score(top_ten, sc) insert_score(struct sc_ent top_ten[NUMSCORE], struct sc_ent *sc)
struct sc_ent top_ten[NUMSCORE];
struct sc_ent *sc;
{ {
int i,j; int i,j;
@ -699,10 +700,8 @@ struct sc_ent *sc;
/* PCS = player-class-system (used to determines uniqueness of player) */ /* PCS = player-class-system (used to determines uniqueness of player) */
int bool
is_pcs_match(sc1,sc2) is_pcs_match(struct sc_ent *sc1, struct sc_ent *sc2)
struct sc_ent *sc1;
struct sc_ent *sc2;
{ {
return( (strcmp(sc1->sc_name,sc2->sc_name) == 0) && return( (strcmp(sc1->sc_name,sc2->sc_name) == 0) &&
(sc1->sc_ctype == sc2->sc_ctype) && (sc1->sc_ctype == sc2->sc_ctype) &&
@ -710,10 +709,8 @@ struct sc_ent *sc2;
} }
int int
count_pcs_matches(top_ten,sc,lowest) count_pcs_matches(struct sc_ent top_ten[NUMSCORE], struct sc_ent *sc,
struct sc_ent top_ten[NUMSCORE]; int *lowest)
struct sc_ent *sc;
int *lowest;
{ {
int i, matches = 0; int i, matches = 0;
@ -729,10 +726,8 @@ int *lowest;
} }
int int
find_most_pcs_matches(top_ten,sc,num,idx) find_most_pcs_matches(struct sc_ent top_ten[NUMSCORE], struct sc_ent *sc,
struct sc_ent top_ten[NUMSCORE]; int *num, int *idx)
struct sc_ent *sc;
int *num, *idx;
{ {
int i, matches, max_match=0, max_match_idx=-1, lowest; int i, matches, max_match=0, max_match_idx=-1, lowest;
@ -761,9 +756,7 @@ int *num, *idx;
int int
add_score(top_ten,sc) add_score(struct sc_ent top_ten[NUMSCORE], struct sc_ent *sc)
struct sc_ent top_ten[NUMSCORE];
struct sc_ent *sc;
{ {
int idx, count; int idx, count;
@ -797,11 +790,10 @@ struct sc_ent *sc;
} }
} }
update(top_ten, amount, quest, whoami, flags, level, monst, ctype, system, login) int
struct sc_ent top_ten[]; update(struct sc_ent top_ten[], unsigned long amount, short quest, char *whoami,
unsigned long amount; short flags, short level, short monst, short ctype, char *system,
short quest, flags, level, monst, ctype; char *login)
char *whoami, *system, *login;
{ {
struct sc_ent sc; struct sc_ent sc;

View file

@ -1222,54 +1222,296 @@ struct sc_ent {
/* /*
* Other structures * Other structures
*/ */
struct linked_list *find_mons(), *find_obj(), *get_item(), *new_item(),
*new_thing(), *wake_monster(), *get_hurl(), *spec_item(),
*creat_item(), *wield_weap();
struct room *roomin(); void _attach(struct linked_list **list, struct linked_list *item);
struct trap *trap_at(); void _detach(struct linked_list **list, struct linked_list *item);
void _o_free_list(struct linked_list **ptr);
void _r_free_fire_list(struct linked_list **ptr);
void _r_free_list(struct linked_list **ptr);
void _t_free_list(struct linked_list **ptr);
int ac_compute(bool ignoremetal);
void activity(void);
bool add_pack(struct linked_list *item, bool silent);
void add_slow(void);
void addmsg(char *fmt, ...);
void affect(void);
void aggravate(bool do_uniques, bool do_good);
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);
bool blue_light(bool blessed, bool cursed);
void buy_it(void);
void byebye(int sig);
bool can_blink(struct thing *tp);
int can_shoot(coord *er, coord *ee, coord *shoot_dir);
bool cansee(int y, int x);
void carry_obj(struct thing *mp, int chance);
void cast(void);
void changeclass(long *newclass);
void chant(void);
void chant_recovery(void);
void chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree,
bool flee);
long check_level(void);
void check_residue(struct thing *tp);
void chg_str(int amt);
void choose_qst(void);
int cloak_charge(struct object *obj);
void command(void);
void confus_player(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_plus(int dexterity);
int dext_prot(int dexterity);
bool diag_ok(coord *sp, coord *ep, struct thing *flgptr);
void dip_it(void);
void do_chase(struct thing *th);
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_panic(int who);
void do_passages(void);
void do_post(bool startup);
void do_rooms(void);
void do_run(char ch);
void do_teleport(void);
void do_terrain(int basey, int basex, int deltay, int deltax, bool fresh);
void do_zap(struct thing *zapper, struct object *obj, coord *direction,
int which, int flags);
void doctor(struct thing *tp);
coord *doorway(struct room *rp, coord *door);
void draw_room(struct room *rp);
bool drop(struct linked_list *item);
bool dropcheck(struct object *op);
void dsrpt_monster(struct thing *tp, bool always, bool see_him);
void dsrpt_player(void);
void dust_appear(void);
void eat(void);
void eat_gold(struct object *obj);
int effect(struct thing *att, struct thing *def, struct object *weap,
bool thrown, bool see_att, bool see_def);
long encread(char *start, unsigned long size, int inf);
long encwrite(char *start, unsigned long size, FILE *outf);
void endit(int sig);
void endmsg(void);
void exit_game(int flag);
void explode(struct thing *tp);
void extinguish(int (*dfunc)());
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)());
int findmindex(char *name);
void fix_stick(struct object *cur);
void fright(struct thing *th);
void fumble(void);
void fuse(int (*dfunc)(), VOID *arg, int time, int type);
void genmonsters(int least, bool treas);
coord get_coordinates(void);
bool get_dir(coord *direction);
struct linked_list *get_hurl(struct thing *tp);
struct linked_list *get_item(struct linked_list *list, char *purpose, int type,
bool askfirst, bool showcost);
int get_str(char *opt, WINDOW *win);
long get_worth(struct object *obj);
int getdeath(void);
bool getdelta(char match, int *dy, int *dx);
void give(struct thing *th);
int grab(int y, int x);
void gsense(void);
void help(void);
bool hit_monster(int y, int x, struct object *obj, struct thing *tp);
int hitweight(void);
void idenpack(void);
void ident_hero(void);
void identify(unsigned char ch);
void init_colors(void);
void init_foods(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 invisible(struct thing *monst);
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 (*dfunc)());
void killed(struct linked_list *item, bool pr, bool points, bool treasure);
int land(void);
void lengthen(int (*dfunc)(), int xtime);
void light(coord *cp);
bool lit_room(struct room *rp);
void look(bool wakeup, bool runend);
void lower_level(short who);
void m_use_relic(struct thing *monster);
void m_use_wand(struct thing *monster);
void make_sell_pack(struct thing *tp);
short makemonster(bool showall, char *action);
bool maze_view(int y, int x);
int misc_name(char *str, struct object *obj);
void missile(int ydelta, int xdelta, struct linked_list *item,
struct thing *tp);
char *monster_name(struct thing *tp);
bool move_hero(int why);
short movement(struct thing *tp);
void msg(char *fmt, ...);
void nameitem(struct linked_list *item, bool mark);
bool need_dir(int type, int which);
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, bool allow_curse);
void nobolt(void);
void nocold(void);
void nofire(void);
void nohaste(void);
void noslow(void);
char *num(int n1, int n2);
void o_discard(struct linked_list *item);
void opt_player(void);
void option(void);
void over_win(WINDOW *oldwin, WINDOW *newin, int maxy, int maxx, int cursory,
int cursorx, char redraw);
char pack_char(struct linked_list *list, struct object *obj);
void parse_opts(char *str);
bool passwd(void);
void picky_inven(void);
bool player_zap(int which, int flag);
void playit(void);
void pray(void);
void prayer_recovery(void);
bool price_it(void);
char *prname(char *who, bool upper);
void quaff(int which, int kind, int flags, bool is_potion);
void quill_charge(void);
void quit(int sig);
void raise_level(void);
short randmonster(bool wander, bool no_unique);
void read_scroll(int which, int flag, bool is_scroll);
void reap(void);
int res_strength(long howmuch);
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 linked_list *item);
void ring_search(void);
void ring_teleport(void);
int ring_value(int type);
void rmmsg(void);
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 runners(int segments);
void runto(struct thing *runner, coord *spot);
bool save(int which, struct thing *who, int adj);
bool save_game(void);
char secretdoor(int y, int x);
void score(unsigned long amount, int flags, short monst);
void search(bool is_thief, bool door_chime);
void sell(struct thing *tp);
void sell_it(void);
void set_trap(struct thing *tp, int y, int x);
void setup(void);
void shoot_bolt(struct thing *shooter, coord start, coord dir,
bool get_points, short reason, char *name, int damage);
bool shoot_ok(int ch);
char show(int y, int x);
void sight(void);
bool skirmish(struct thing *attacker, coord *mp, struct object *weap,
bool thrown);
struct linked_list *spec_item(int type, int which, int hit, int damage);
void spell_recovery(void);
void start_daemon(int (*dfunc)(), 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);
int str_plus(short str);
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 take_off(void);
void take_with(void);
void teleport(void);
void total_winner(void);
int totalenc(struct thing *tp);
char *tr_name(char ch);
struct trap *trap_at(int y, int x);
void trap_look(void);
void unchoke(void);
void unclrhead(void);
void unconfuse(void);
int undance(void);
void unphase(void);
void unsee(void);
void unskill(void);
void unstink(void);
void updpack(int getmax, struct thing *tp);
int usage_time(struct linked_list *item);
void use_mm(int which);
char *vowelstr(char *str);
void wait_for(char ch);
struct linked_list *wake_monster(int y, int x);
void wake_room(struct room *rp);
void wanderer(void);
void waste_time(void);
int weap_move(struct thing *wielder, struct object *weap);
char *weap_name(struct object *obj);
void wear(void);
void wghtchk(void);
void whatis(struct linked_list *what);
void wield(void);
struct linked_list *wield_weap(struct object *thrown, struct thing *mp);
void writelog(unsigned long amount, int flags, short monst);
void xsense(void);
char *getenv(), *tr_name(), *new(), *vowelstr(), char *getenv(), *misc_num();
*inv_name(), *num(),
*ring_num(), *misc_num(), *blesscurse(), *p_kind(), *typ_name(),
*prname(), *monster_name(), *weap_name();
coord rndmove(), *fallpos(), *doorway(), get_coordinates(); int usage_time();
int can_shoot(),misc_name();
short randmonster(), id_monst(), movement(); void tstp();
int bugkill(), nohaste(), spell_recovery(), doctor(), runners(), swander(), int md_getuid(void);
unconfuse(), unsee(), fumble(), unclrhead(), unphase(), noslow(), long md_memused(void);
rollwand(), stomach(), sight(), unstink(), suffocate(), cure_disease(), int md_normaluser(void);
shoot_bolt(), changeclass(), appear(), dust_appear(), unchoke(), int md_rand(int range);
alchemy(), trap_look(), strangle(), ring_teleport(), ring_search(), void md_setup(void);
grab(), dsrpt_player(), quill_charge(), make_sell_pack(), unskill(), int md_shellescape(void);
findmindex(), nobolt(), nofire(), nocold(), usage_time(), eat_gold(), int md_srand(int seed);
chant_recovery(), prayer_recovery(), dsrpt_monster(), opt_player();
bool blue_light(), can_blink(), creat_mons(), add_pack(), invisible(),
straight_shot(), maze_view(), lit_room(), getdelta(), save_file(),
save_game(), m_use_it(), m_use_pack(), get_dir(), need_dir(),passwd();
long check_level();
long encread();
long get_worth();
long encwrite();
void byebye(int sig), genmonsters(), quit(int sig),
auto_save(int sig), endit(int sig), tstp();
void teleport();
void writelog(unsigned long amount, int flags, short monst);
int undance(), land(), cloak_charge(), wghtchk();
int add_intelligence(), add_strength(), add_wisdom(), add_dexterity(),
add_constitution(), add_charisma(), res_intelligence(), res_strength(),
res_wisdom(), res_dexterity(), res_constitution(), res_charisma();
/* /*
* Now all the global variables * Now all the global variables
@ -1405,7 +1647,7 @@ extern char *retstr;
extern FILE *scorefi; extern FILE *scorefi;
extern FILE *logfile; extern FILE *logfile;
extern LEVTYPE levtype; extern LEVTYPE levtype;
extern int (*add_abil[NUMABILITIES])(); /* Functions to change abilities */ extern int (*add_abil[NUMABILITIES])(int); /* Functions to change abilities */
extern int (*res_abil[NUMABILITIES])(); /* Functions to change abilities */ extern int (*res_abil[NUMABILITIES])(); /* Functions to change abilities */
extern int mf_count; /* move_free counter - see actions.c(m_act()) */ extern int mf_count; /* move_free counter - see actions.c(m_act()) */
extern int mf_jmpcnt; /* move_free counter for # of jumps */ extern int mf_jmpcnt; /* move_free counter for # of jumps */

View file

@ -20,7 +20,11 @@
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
do_rooms() void horiz(int cnt);
void vert(int cnt);
void
do_rooms(void)
{ {
register int i; register int i;
register struct room *rp; register struct room *rp;
@ -107,7 +111,7 @@ do_rooms()
has_gold = TRUE; /* This room has gold in it */ 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); cur = OBJPTR(item);
/* Put the gold into the level list of items */ /* Put the gold into the level list of items */
@ -177,9 +181,7 @@ do_rooms()
*/ */
coord * coord *
doorway(rp, door) doorway(struct room *rp, coord *door)
register struct room *rp;
register coord *door;
{ {
register int misses = 0; register int misses = 0;
static coord answer; static coord answer;
@ -208,8 +210,8 @@ register coord *door;
* Draw a box around a room * Draw a box around a room
*/ */
draw_room(rp) void
register struct room *rp; draw_room(struct room *rp)
{ {
register int j, k; register int j, k;
@ -236,8 +238,8 @@ register struct room *rp;
* draw a horizontal line * draw a horizontal line
*/ */
horiz(cnt) void
register int cnt; horiz(int cnt)
{ {
while (cnt--) while (cnt--)
addch(HORZWALL); addch(HORZWALL);
@ -248,9 +250,8 @@ register int cnt;
* pick a random spot in a room * pick a random spot in a room
*/ */
rnd_pos(rp, cp) void
register struct room *rp; rnd_pos(struct room *rp, coord *cp)
register coord *cp;
{ {
cp->x = rp->r_pos.x + rnd(rp->r_max.x-2) + 1; 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; cp->y = rp->r_pos.y + rnd(rp->r_max.y-2) + 1;
@ -265,8 +266,7 @@ register coord *cp;
*/ */
struct room * struct room *
roomin(cp) roomin(coord *cp)
register coord *cp;
{ {
register struct room *rp; register struct room *rp;
@ -281,8 +281,8 @@ register coord *cp;
* draw a vertical line * draw a vertical line
*/ */
vert(cnt) void
register int cnt; vert(int cnt)
{ {
register int x, y; register int x, y;

View file

@ -31,10 +31,16 @@ extern char version[];
extern unsigned char encstr[]; extern unsigned char encstr[];
extern int big_endian; extern int big_endian;
bool rs_write_int(FILE *savef, int c);
bool rs_read_int(int inf, int *i);
bool rs_save_file(FILE *savef);
bool rs_restore_file(int inf);
int md_unlink(char *file); int md_unlink(char *file);
bool save_file(FILE *savef);
bool bool
save_game() save_game(void)
{ {
register FILE *savef; register FILE *savef;
register int c; register int c;
@ -129,12 +135,11 @@ auto_save(int sig)
*/ */
bool bool
save_file(savef) save_file(FILE *savef)
register FILE *savef;
{ {
int slines = LINES; int slines = LINES;
int scols = COLS; int scols = COLS;
int ret = FALSE; bool ret = FALSE;
int endian = 0x01020304; int endian = 0x01020304;
big_endian = ( *((char *)&endian) == 0x01 ); big_endian = ( *((char *)&endian) == 0x01 );
@ -150,9 +155,8 @@ register FILE *savef;
return(ret); return(ret);
} }
restore(file, envp) bool
register char *file; restore(char *file, char *envp[])
char **envp;
{ {
register int inf; register int inf;
extern char **environ; extern char **environ;
@ -251,10 +255,7 @@ char **envp;
*/ */
long long
encwrite(start, size, outf) encwrite(char *start, unsigned long size, FILE *outf)
register char *start;
register unsigned long size;
register FILE *outf;
{ {
register unsigned char *ep; register unsigned char *ep;
register int i = 0; register int i = 0;
@ -292,10 +293,7 @@ register FILE *outf;
*/ */
long long
encread(start, size, inf) encread(char *start, unsigned long size, int inf)
register char *start;
register unsigned long size;
int inf;
{ {
register unsigned char *ep; register unsigned char *ep;
register int rd_siz; register int rd_siz;

View file

@ -17,6 +17,7 @@
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <curses.h> #include <curses.h>
#include <ctype.h> #include <ctype.h>
#include "rogue.h" #include "rogue.h"
@ -25,7 +26,8 @@
* let the hero get rid of some type of monster * let the hero get rid of some type of monster
*/ */
genocide() void
genocide(void)
{ {
register struct linked_list *ip; register struct linked_list *ip;
register struct thing *mp; register struct thing *mp;
@ -56,10 +58,8 @@ genocide()
msg("You have wiped out the %s.", monsters[which_monst].m_name); msg("You have wiped out the %s.", monsters[which_monst].m_name);
} }
read_scroll(which, flag, is_scroll) void
register int which; read_scroll(int which, int flag, bool is_scroll)
int flag;
bool is_scroll;
{ {
register struct object *obj = NULL, *nobj; register struct object *obj = NULL, *nobj;
register struct linked_list *item, *nitem; register struct linked_list *item, *nitem;
@ -499,7 +499,7 @@ bool is_scroll;
nobj->o_flags &= ~ISCURSED; nobj->o_flags &= ~ISCURSED;
} }
msg("Your pack glistens brightly!"); msg("Your pack glistens brightly!");
do_panic(NULL); /* this startles them */ do_panic(0); /* this startles them */
/* return; leaks item, go through end of function */ /* return; leaks item, go through end of function */
} }
else { else {

View file

@ -97,6 +97,14 @@ int format_error = FALSE;
int save_debug = FALSE; int save_debug = FALSE;
#define DBG(x) {if (save_debug) rsPrintf x;} #define DBG(x) {if (save_debug) rsPrintf x;}
bool rs_read_new_string(int inf, char **s);
int find_list_ptr(struct linked_list *l, void *ptr);
bool rs_write_coord_list(FILE *savef, struct linked_list *l);
bool rs_read_coord_list(int inf, struct linked_list **list);
int list_size(struct linked_list *l);
bool rs_write_object_list(FILE *savef, struct linked_list *l);
bool rs_read_object_list(int inf, struct linked_list **list);
int int
rsPrintf(char *fmt, ...) rsPrintf(char *fmt, ...)
{ {
@ -128,6 +136,7 @@ get_list_item(struct linked_list *l, int i)
return(NULL); return(NULL);
} }
bool
rs_write(FILE *savef, void *ptr, size_t size) rs_write(FILE *savef, void *ptr, size_t size)
{ {
size_t i = 0; size_t i = 0;
@ -143,6 +152,7 @@ rs_write(FILE *savef, void *ptr, size_t size)
int end_of_file = FALSE; int end_of_file = FALSE;
bool
rs_read(int inf, void *ptr, size_t size) rs_read(int inf, void *ptr, size_t size)
{ {
int actual; int actual;
@ -165,6 +175,7 @@ rs_read(int inf, void *ptr, size_t size)
int big_endian = 0; int big_endian = 0;
bool
rs_write_uint(FILE *savef, unsigned int c) rs_write_uint(FILE *savef, unsigned int c)
{ {
char bytes[4]; char bytes[4];
@ -184,6 +195,7 @@ rs_write_uint(FILE *savef, unsigned int c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_int(FILE *savef, int c) rs_write_int(FILE *savef, int c)
{ {
char bytes[4]; char bytes[4];
@ -203,6 +215,7 @@ rs_write_int(FILE *savef, int c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_ulong(FILE *savef, unsigned long c) rs_write_ulong(FILE *savef, unsigned long c)
{ {
unsigned int c2; unsigned int c2;
@ -229,6 +242,7 @@ rs_write_ulong(FILE *savef, unsigned long c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_long(FILE *savef, long c) rs_write_long(FILE *savef, long c)
{ {
int c2; int c2;
@ -255,6 +269,7 @@ rs_write_long(FILE *savef, long c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_boolean(FILE *savef, bool c) rs_write_boolean(FILE *savef, bool c)
{ {
char buf; char buf;
@ -269,6 +284,7 @@ rs_write_boolean(FILE *savef, bool c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_int(int inf, int *i) rs_read_int(int inf, int *i)
{ {
char bytes[4]; char bytes[4];
@ -291,6 +307,7 @@ rs_read_int(int inf, int *i)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_uint(int inf, unsigned int *i) rs_read_uint(int inf, unsigned int *i)
{ {
char bytes[4]; char bytes[4];
@ -313,6 +330,7 @@ rs_read_uint(int inf, unsigned int *i)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_ulong(int inf, unsigned long *i) rs_read_ulong(int inf, unsigned long *i)
{ {
char bytes[4]; char bytes[4];
@ -337,6 +355,7 @@ rs_read_ulong(int inf, unsigned long *i)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_long(int inf, long *i) rs_read_long(int inf, long *i)
{ {
char bytes[4]; char bytes[4];
@ -361,6 +380,7 @@ rs_read_long(int inf, long *i)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_boolean(int inf, bool *i) rs_read_boolean(int inf, bool *i)
{ {
char buf; char buf;
@ -372,6 +392,7 @@ rs_read_boolean(int inf, bool *i)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_ints(FILE *savef, int *c, int count) rs_write_ints(FILE *savef, int *c, int count)
{ {
int n=0; int n=0;
@ -384,6 +405,7 @@ rs_write_ints(FILE *savef, int *c, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_short(FILE *savef, short c) rs_write_short(FILE *savef, short c)
{ {
char bytes[2]; char bytes[2];
@ -401,6 +423,7 @@ rs_write_short(FILE *savef, short c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_short(int inf, short *s) rs_read_short(int inf, short *s)
{ {
char bytes[2]; char bytes[2];
@ -421,6 +444,7 @@ rs_read_short(int inf, short *s)
} }
bool
rs_write_shorts(FILE *savef, short *c, int count) rs_write_shorts(FILE *savef, short *c, int count)
{ {
int n=0; int n=0;
@ -433,6 +457,7 @@ rs_write_shorts(FILE *savef, short *c, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_longs(FILE *savef, long *c, int count) rs_write_longs(FILE *savef, long *c, int count)
{ {
int n=0; int n=0;
@ -445,6 +470,7 @@ rs_write_longs(FILE *savef, long *c, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_ulongs(FILE *savef, unsigned long *c, int count) rs_write_ulongs(FILE *savef, unsigned long *c, int count)
{ {
int n=0; int n=0;
@ -457,6 +483,7 @@ rs_write_ulongs(FILE *savef, unsigned long *c, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_booleans(FILE *savef, bool *c, int count) rs_write_booleans(FILE *savef, bool *c, int count)
{ {
int n=0; int n=0;
@ -469,6 +496,7 @@ rs_write_booleans(FILE *savef, bool *c, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_ints(int inf, int *i, int count) rs_read_ints(int inf, int *i, int count)
{ {
int n=0,value=0; int n=0,value=0;
@ -487,6 +515,7 @@ rs_read_ints(int inf, int *i, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_shorts(int inf, short *i, int count) rs_read_shorts(int inf, short *i, int count)
{ {
int n=0,value=0; int n=0,value=0;
@ -505,6 +534,7 @@ rs_read_shorts(int inf, short *i, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_longs(int inf, long *i, int count) rs_read_longs(int inf, long *i, int count)
{ {
int n=0,value=0; int n=0,value=0;
@ -523,6 +553,7 @@ rs_read_longs(int inf, long *i, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_ulongs(int inf, unsigned long *i, int count) rs_read_ulongs(int inf, unsigned long *i, int count)
{ {
int n=0,value=0; int n=0,value=0;
@ -541,6 +572,7 @@ rs_read_ulongs(int inf, unsigned long *i, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_booleans(int inf, bool *i, int count) rs_read_booleans(int inf, bool *i, int count)
{ {
int n=0,value=0; int n=0,value=0;
@ -559,6 +591,7 @@ rs_read_booleans(int inf, bool *i, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_levtype(FILE *savef, LEVTYPE c) rs_write_levtype(FILE *savef, LEVTYPE c)
{ {
int lt; int lt;
@ -578,6 +611,7 @@ rs_write_levtype(FILE *savef, LEVTYPE c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_levtype(int inf, LEVTYPE *l) rs_read_levtype(int inf, LEVTYPE *l)
{ {
int lt; int lt;
@ -597,6 +631,7 @@ rs_read_levtype(int inf, LEVTYPE *l)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_char(FILE *savef, char c) rs_write_char(FILE *savef, char c)
{ {
rs_write(savef, &c, 1); rs_write(savef, &c, 1);
@ -605,6 +640,7 @@ rs_write_char(FILE *savef, char c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_char(int inf, char *c) rs_read_char(int inf, char *c)
{ {
rs_read(inf, c, 1); rs_read(inf, c, 1);
@ -612,6 +648,7 @@ rs_read_char(int inf, char *c)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_uchar(FILE *savef, unsigned char c) rs_write_uchar(FILE *savef, unsigned char c)
{ {
rs_write(savef, &c, 1); rs_write(savef, &c, 1);
@ -620,6 +657,7 @@ rs_write_uchar(FILE *savef, unsigned char c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_uchar(int inf, unsigned char *c) rs_read_uchar(int inf, unsigned char *c)
{ {
rs_read(inf, c, 1); rs_read(inf, c, 1);
@ -627,6 +665,7 @@ rs_read_uchar(int inf, unsigned char *c)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_string(FILE *savef, char *s) rs_write_string(FILE *savef, char *s)
{ {
int len = 0; int len = 0;
@ -639,6 +678,7 @@ rs_write_string(FILE *savef, char *s)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_string_index(int inf, struct words master[], int maxindex, char **str) rs_read_string_index(int inf, struct words master[], int maxindex, char **str)
{ {
int i; int i;
@ -660,6 +700,7 @@ rs_read_string_index(int inf, struct words master[], int maxindex, char **str)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_string_index(FILE *savef, struct words master[], int maxindex, char *str) rs_write_string_index(FILE *savef, struct words master[], int maxindex, char *str)
{ {
int i; int i;
@ -677,6 +718,7 @@ rs_write_string_index(FILE *savef, struct words master[], int maxindex, char *st
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_scrolls(int inf) rs_read_scrolls(int inf)
{ {
int i; int i;
@ -691,6 +733,7 @@ rs_read_scrolls(int inf)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_scrolls(FILE *savef) rs_write_scrolls(FILE *savef)
{ {
int i; int i;
@ -701,9 +744,10 @@ rs_write_scrolls(FILE *savef)
rs_write_boolean(savef,s_know[i]); rs_write_boolean(savef,s_know[i]);
rs_write_string(savef,s_guess[i]); rs_write_string(savef,s_guess[i]);
} }
return(READSTAT); return(WRITESTAT);
} }
bool
rs_read_potions(int inf) rs_read_potions(int inf)
{ {
int i; int i;
@ -718,6 +762,7 @@ rs_read_potions(int inf)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_potions(FILE *savef) rs_write_potions(FILE *savef)
{ {
int i; int i;
@ -732,6 +777,7 @@ rs_write_potions(FILE *savef)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_rings(int inf) rs_read_rings(int inf)
{ {
int i; int i;
@ -746,6 +792,7 @@ rs_read_rings(int inf)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_rings(FILE *savef) rs_write_rings(FILE *savef)
{ {
int i; int i;
@ -760,6 +807,7 @@ rs_write_rings(FILE *savef)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_misc(int inf) rs_read_misc(int inf)
{ {
int i; int i;
@ -773,6 +821,7 @@ rs_read_misc(int inf)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_misc(FILE *savef) rs_write_misc(FILE *savef)
{ {
int i; int i;
@ -786,6 +835,7 @@ rs_write_misc(FILE *savef)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_sticks(FILE *savef) rs_write_sticks(FILE *savef)
{ {
int i; int i;
@ -809,6 +859,7 @@ rs_write_sticks(FILE *savef)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_sticks(int inf) rs_read_sticks(int inf)
{ {
int i = 0, list = 0; int i = 0, list = 0;
@ -833,6 +884,7 @@ rs_read_sticks(int inf)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_string(int inf, char *s, int max) rs_read_string(int inf, char *s, int max)
{ {
int len = 0; int len = 0;
@ -852,6 +904,7 @@ rs_read_string(int inf, char *s, int max)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_new_string(int inf, char **s) rs_read_new_string(int inf, char **s)
{ {
int len=0; int len=0;
@ -878,6 +931,7 @@ rs_read_new_string(int inf, char **s)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_strings(FILE *savef, char *s[], int count) rs_write_strings(FILE *savef, char *s[], int count)
{ {
int len = 0; int len = 0;
@ -896,6 +950,7 @@ rs_write_strings(FILE *savef, char *s[], int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_write_words(FILE *savef, struct words *w, int count) rs_write_words(FILE *savef, struct words *w, int count)
{ {
int n = 0; int n = 0;
@ -911,6 +966,7 @@ rs_write_words(FILE *savef, struct words *w, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_words(int inf, struct words *w, int count) rs_read_words(int inf, struct words *w, int count)
{ {
int n = 0; int n = 0;
@ -933,6 +989,7 @@ rs_read_words(int inf, struct words *w, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_read_new_strings(int inf, char **s, int count) rs_read_new_strings(int inf, char **s, int count)
{ {
int len = 0; int len = 0;
@ -966,6 +1023,7 @@ rs_read_new_strings(int inf, char **s, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_coord(FILE *savef, coord *c) rs_write_coord(FILE *savef, coord *c)
{ {
DBG(("X =")); DBG(("X ="));
@ -976,6 +1034,7 @@ rs_write_coord(FILE *savef, coord *c)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_coord(int inf, coord *c) rs_read_coord(int inf, coord *c)
{ {
rs_read_int(inf,&c->x); rs_read_int(inf,&c->x);
@ -1047,6 +1106,7 @@ struct object *find_alchemy_jug(int n) {
return tobj; return tobj;
} }
bool
rs_write_daemons(FILE *savef, struct delayed_action *d_list,int count) rs_write_daemons(FILE *savef, struct delayed_action *d_list,int count)
{ {
int i = 0; int i = 0;
@ -1173,6 +1233,7 @@ rs_write_daemons(FILE *savef, struct delayed_action *d_list,int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_daemons(int inf, struct delayed_action *d_list, int count) rs_read_daemons(int inf, struct delayed_action *d_list, int count)
{ {
int i = 0; int i = 0;
@ -1344,6 +1405,7 @@ rs_read_daemons(int inf, struct delayed_action *d_list, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_rooms(FILE *savef, struct room r[], int count) rs_write_rooms(FILE *savef, struct room r[], int count)
{ {
int n = 0,i = -1; int n = 0,i = -1;
@ -1376,6 +1438,7 @@ rs_write_rooms(FILE *savef, struct room r[], int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_rooms(int inf, struct room *r, int count) rs_read_rooms(int inf, struct room *r, int count)
{ {
int value = 0, n = 0, i = 0, index = 0, id = 0; int value = 0, n = 0, i = 0, index = 0, id = 0;
@ -1436,6 +1499,7 @@ rs_read_rooms(int inf, struct room *r, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_object(FILE *savef, struct object *o) rs_write_object(FILE *savef, struct object *o)
{ {
rs_write_int(savef, RSXR_OBJECT); rs_write_int(savef, RSXR_OBJECT);
@ -1487,6 +1551,7 @@ rs_write_object(FILE *savef, struct object *o)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_object(int inf, struct object *o) rs_read_object(int inf, struct object *o)
{ {
int id; int id;
@ -1523,6 +1588,7 @@ rs_read_object(int inf, struct object *o)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_stats(FILE *savef, struct stats *s) rs_write_stats(FILE *savef, struct stats *s)
{ {
DBG(("Stats\n")); DBG(("Stats\n"));
@ -1546,6 +1612,7 @@ rs_write_stats(FILE *savef, struct stats *s)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_stats(int inf, struct stats *s) rs_read_stats(int inf, struct stats *s)
{ {
int id; int id;
@ -1580,6 +1647,7 @@ rs_read_stats(int inf, struct stats *s)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_mstats(FILE *savef, struct mstats *s) rs_write_mstats(FILE *savef, struct mstats *s)
{ {
DBG(("M-Stats\n")); DBG(("M-Stats\n"));
@ -1598,6 +1666,7 @@ rs_write_mstats(FILE *savef, struct mstats *s)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_mstats(int inf, struct mstats *s) rs_read_mstats(int inf, struct mstats *s)
{ {
int id; int id;
@ -1634,6 +1703,7 @@ rs_read_mstats(int inf, struct mstats *s)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_init_weps(FILE *savef, struct init_weps *w, int count) rs_write_init_weps(FILE *savef, struct init_weps *w, int count)
{ {
int i; int i;
@ -1656,6 +1726,7 @@ rs_write_init_weps(FILE *savef, struct init_weps *w, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_init_weps(int inf, struct init_weps *w,int count) rs_read_init_weps(int inf, struct init_weps *w,int count)
{ {
int id,value,i; int id,value,i;
@ -1684,6 +1755,7 @@ rs_read_init_weps(int inf, struct init_weps *w,int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_init_armor(FILE *savef, struct init_armor *a, int count) rs_write_init_armor(FILE *savef, struct init_armor *a, int count)
{ {
int i; int i;
@ -1701,6 +1773,7 @@ rs_write_init_armor(FILE *savef, struct init_armor *a, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_init_armor(int inf, struct init_armor *a,int count) rs_read_init_armor(int inf, struct init_armor *a,int count)
{ {
int id,value,i; int id,value,i;
@ -1720,6 +1793,7 @@ rs_read_init_armor(int inf, struct init_armor *a,int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_spells(FILE *savef, struct spells *s, int count) rs_write_spells(FILE *savef, struct spells *s, int count)
{ {
int i; int i;
@ -1736,6 +1810,7 @@ rs_write_spells(FILE *savef, struct spells *s, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_spells(int inf, struct spells *s,int count) rs_read_spells(int inf, struct spells *s,int count)
{ {
int id,value,i; int id,value,i;
@ -1753,6 +1828,7 @@ rs_read_spells(int inf, struct spells *s,int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_item_list(FILE *savef, struct item_list *i) rs_write_item_list(FILE *savef, struct item_list *i)
{ {
DBG(("Item List\n")); DBG(("Item List\n"));
@ -1761,6 +1837,8 @@ rs_write_item_list(FILE *savef, struct item_list *i)
rs_write(savef, i->item_desc, sizeof(i->item_desc)); rs_write(savef, i->item_desc, sizeof(i->item_desc));
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_item_list(int inf, struct item_list *i) rs_read_item_list(int inf, struct item_list *i)
{ {
int id; int id;
@ -1772,6 +1850,7 @@ rs_read_item_list(int inf, struct item_list *i)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_h_list(FILE *savef, struct h_list *h) rs_write_h_list(FILE *savef, struct h_list *h)
{ {
DBG(("H List\n")); DBG(("H List\n"));
@ -1781,6 +1860,7 @@ rs_write_h_list(FILE *savef, struct h_list *h)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_h_list(int inf, struct h_list *h) rs_read_h_list(int inf, struct h_list *h)
{ {
int id; int id;
@ -1792,6 +1872,7 @@ rs_read_h_list(int inf, struct h_list *h)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_death_types(FILE *savef, struct death_type *d,int count) rs_write_death_types(FILE *savef, struct death_type *d,int count)
{ {
int i; int i;
@ -1807,6 +1888,8 @@ rs_write_death_types(FILE *savef, struct death_type *d,int count)
} }
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_death_types(int inf, struct death_type *d, int count) rs_read_death_types(int inf, struct death_type *d, int count)
{ {
int id,value,i; int id,value,i;
@ -1828,6 +1911,7 @@ rs_read_death_types(int inf, struct death_type *d, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_character_types(FILE *savef, struct character_types *c, int count) rs_write_character_types(FILE *savef, struct character_types *c, int count)
{ {
int i; int i;
@ -1851,6 +1935,7 @@ rs_write_character_types(FILE *savef, struct character_types *c, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_character_types(int inf, struct character_types *c,int count) rs_read_character_types(int inf, struct character_types *c,int count)
{ {
int id,value,i; int id,value,i;
@ -1880,6 +1965,7 @@ rs_read_character_types(int inf, struct character_types *c,int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_traps(FILE *savef, struct trap *trap,int count) rs_write_traps(FILE *savef, struct trap *trap,int count)
{ {
int n; int n;
@ -1895,8 +1981,10 @@ rs_write_traps(FILE *savef, struct trap *trap,int count)
rs_write_coord(savef, &trap[n].tr_pos); rs_write_coord(savef, &trap[n].tr_pos);
rs_write_long(savef, trap[n].tr_flags); rs_write_long(savef, trap[n].tr_flags);
} }
return(WRITESTAT);
} }
bool
rs_read_traps(int inf, struct trap *trap, int count) rs_read_traps(int inf, struct trap *trap, int count)
{ {
int id = 0, value = 0, n = 0; int id = 0, value = 0, n = 0;
@ -1937,6 +2025,7 @@ rs_read_traps(int inf, struct trap *trap, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_monsters(FILE * savef, struct monster * m, int count) rs_write_monsters(FILE * savef, struct monster * m, int count)
{ {
int n; int n;
@ -1965,6 +2054,7 @@ rs_write_monsters(FILE * savef, struct monster * m, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_monsters(int inf, struct monster *m, int count) rs_read_monsters(int inf, struct monster *m, int count)
{ {
int id = 0, value = 0, n = 0; int id = 0, value = 0, n = 0;
@ -2024,6 +2114,7 @@ rs_read_monsters(int inf, struct monster *m, int count)
/*****************************************************************************/ /*****************************************************************************/
bool
rs_write_coord_list(FILE *savef, struct linked_list *l) rs_write_coord_list(FILE *savef, struct linked_list *l)
{ {
DBG(("Coordinate List\n")); DBG(("Coordinate List\n"));
@ -2039,6 +2130,7 @@ rs_write_coord_list(FILE *savef, struct linked_list *l)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_coord_list(int inf, struct linked_list **list) rs_read_coord_list(int inf, struct linked_list **list)
{ {
int id; int id;
@ -2082,6 +2174,7 @@ rs_read_coord_list(int inf, struct linked_list **list)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_object_list(FILE *savef, struct linked_list *l) rs_write_object_list(FILE *savef, struct linked_list *l)
{ {
DBG(("Object List\n")); DBG(("Object List\n"));
@ -2097,6 +2190,7 @@ rs_write_object_list(FILE *savef, struct linked_list *l)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_object_list(int inf, struct linked_list **list) rs_read_object_list(int inf, struct linked_list **list)
{ {
int id; int id;
@ -2175,6 +2269,7 @@ coord *c;
return(-1); return(-1);
} }
bool
rs_write_thing(FILE *savef, struct thing *t) rs_write_thing(FILE *savef, struct thing *t)
{ {
int i = -1; int i = -1;
@ -2285,6 +2380,7 @@ rs_write_thing(FILE *savef, struct thing *t)
return(WRITESTAT); return(WRITESTAT);
} }
void
rs_fix_thing(struct thing *t) rs_fix_thing(struct thing *t)
{ {
struct linked_list *item; struct linked_list *item;
@ -2302,6 +2398,7 @@ rs_fix_thing(struct thing *t)
} }
} }
bool
rs_read_thing(int inf, struct thing *t) rs_read_thing(int inf, struct thing *t)
{ {
int id; int id;
@ -2413,6 +2510,7 @@ list_size(struct linked_list *l)
} }
bool
rs_write_monster_list(FILE *savef, struct linked_list *l) rs_write_monster_list(FILE *savef, struct linked_list *l)
{ {
int cnt = 0; int cnt = 0;
@ -2435,8 +2533,8 @@ rs_write_monster_list(FILE *savef, struct linked_list *l)
return(WRITESTAT); return(WRITESTAT);
} }
rs_fix_monster_list(list) void
struct linked_list *list; rs_fix_monster_list(struct linked_list *list)
{ {
struct linked_list *item; struct linked_list *item;
@ -2444,6 +2542,7 @@ struct linked_list *list;
rs_fix_thing(THINGPTR(item)); rs_fix_thing(THINGPTR(item));
} }
bool
rs_read_monster_list(int inf, struct linked_list **list) rs_read_monster_list(int inf, struct linked_list **list)
{ {
int id; int id;
@ -2485,6 +2584,7 @@ rs_read_monster_list(int inf, struct linked_list **list)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_magic_items(FILE *savef, struct magic_item *i, int count) rs_write_magic_items(FILE *savef, struct magic_item *i, int count)
{ {
int n; int n;
@ -2505,6 +2605,7 @@ rs_write_magic_items(FILE *savef, struct magic_item *i, int count)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_read_magic_items(int inf, struct magic_item *mi, int count) rs_read_magic_items(int inf, struct magic_item *mi, int count)
{ {
int id; int id;
@ -2546,6 +2647,7 @@ rs_read_magic_items(int inf, struct magic_item *mi, int count)
return(READSTAT); return(READSTAT);
} }
bool
rs_write_window(FILE *savef, WINDOW *win) rs_write_window(FILE *savef, WINDOW *win)
{ {
int row,col,height,width; int row,col,height,width;
@ -2558,8 +2660,11 @@ rs_write_window(FILE *savef, WINDOW *win)
for(row=0;row<height;row++) for(row=0;row<height;row++)
for(col=0;col<width;col++) for(col=0;col<width;col++)
rs_write_int(savef, mvwinch(win,row,col)); rs_write_int(savef, mvwinch(win,row,col));
return(WRITESTAT);
} }
bool
rs_read_window(int inf, WINDOW *win) rs_read_window(int inf, WINDOW *win)
{ {
int row,col,maxlines,maxcols,value,width,height; int row,col,maxlines,maxcols,value,width,height;
@ -2588,6 +2693,7 @@ rs_read_window(int inf, WINDOW *win)
return(READSTAT); return(READSTAT);
} }
bool
rs_save_file(FILE *savef) rs_save_file(FILE *savef)
{ {
int i, weapon, armor, ring, misc, room = -1; int i, weapon, armor, ring, misc, room = -1;
@ -2743,6 +2849,7 @@ rs_save_file(FILE *savef)
return(WRITESTAT); return(WRITESTAT);
} }
bool
rs_restore_file(int inf) rs_restore_file(int inf)
{ {
int weapon, armor, ring, misc, room = -1,i,checkpoint; int weapon, armor, ring, misc, room = -1,i,checkpoint;
@ -2904,6 +3011,7 @@ rs_restore_file(int inf)
return(READSTAT); return(READSTAT);
} }
void
rs_write_scorefile(FILE *savef, struct sc_ent *entries, int count) rs_write_scorefile(FILE *savef, struct sc_ent *entries, int count)
{ {
int i; int i;
@ -2923,6 +3031,7 @@ rs_write_scorefile(FILE *savef, struct sc_ent *entries, int count)
} }
} }
int
rs_read_scorefile(FILE *savef, struct sc_ent *entries, int count) rs_read_scorefile(FILE *savef, struct sc_ent *entries, int count)
{ {
int i,available = 0; int i,available = 0;
@ -2954,6 +3063,7 @@ rs_read_scorefile(FILE *savef, struct sc_ent *entries, int count)
void
rs_print_thing(FILE *outf, struct thing *thing, char *prefix, int list, int index) rs_print_thing(FILE *outf, struct thing *thing, char *prefix, int list, int index)
{ {
int i; int i;
@ -2995,6 +3105,7 @@ rs_print_thing(FILE *outf, struct thing *thing, char *prefix, int list, int inde
fprintf(outf,"%st_reserved : %d\n",prefix,thing->t_reserved); fprintf(outf,"%st_reserved : %d\n",prefix,thing->t_reserved);
} }
void
rs_print_game_state(FILE *outf) rs_print_game_state(FILE *outf)
{ {
fprintf(outf, "Player\n"); fprintf(outf, "Player\n");
@ -3025,8 +3136,7 @@ rs_print_game_state(FILE *outf)
****/ ****/
int int
md_rand(range) md_rand(int range)
register int range;
{ {
#ifdef _WIN32 #ifdef _WIN32
return(range <= 0 ? 0 : rand() % range); return(range <= 0 ? 0 : rand() % range);
@ -3036,8 +3146,7 @@ register int range;
} }
int int
md_srand(seed) md_srand(int seed)
register int seed;
{ {
#ifdef _WIN32 #ifdef _WIN32
srand(seed); srand(seed);
@ -3047,7 +3156,7 @@ register int seed;
} }
void void
md_flushinp() md_flushinp(void)
{ {
/* ioctl(0,TIOCFLUSH) */ /* ioctl(0,TIOCFLUSH) */
/* ioctl(_tty_ch,TCFLSH,0) */ /* ioctl(_tty_ch,TCFLSH,0) */
@ -3055,7 +3164,7 @@ md_flushinp()
} }
int int
md_getuid() md_getuid(void)
{ {
#ifdef _WIN32 #ifdef _WIN32
return(42); return(42);
@ -3065,7 +3174,7 @@ md_getuid()
} }
long long
md_memused() md_memused(void)
{ {
#ifdef _WIN32 #ifdef _WIN32
MEMORYSTATUS stat; MEMORYSTATUS stat;
@ -3079,7 +3188,7 @@ md_memused()
} }
char * char *
md_getusername() md_getusername(void)
{ {
static char login[80]; static char login[80];
char *l = NULL; char *l = NULL;
@ -3114,7 +3223,7 @@ md_getusername()
} }
char * char *
md_gethomedir() md_gethomedir(void)
{ {
static char homedir[PATH_MAX]; static char homedir[PATH_MAX];
char *h = NULL; char *h = NULL;
@ -3181,7 +3290,7 @@ directory_exists(char *dirname)
} }
char * char *
md_getroguedir() md_getroguedir(void)
{ {
static char path[1024]; static char path[1024];
char *end,*home; char *end,*home;
@ -3218,7 +3327,7 @@ md_getroguedir()
} }
char * char *
md_getshell() md_getshell(void)
{ {
static char shell[PATH_MAX]; static char shell[PATH_MAX];
char *s = NULL; char *s = NULL;
@ -3246,7 +3355,7 @@ md_getshell()
} }
char * char *
md_gethostname() md_gethostname(void)
{ {
static char nodename[80]; static char nodename[80];
char *n = NULL; char *n = NULL;
@ -3268,7 +3377,7 @@ md_gethostname()
} }
int int
md_shellescape() md_shellescape(void)
{ {
#if (!defined(_WIN32) && !defined(__DJGPP__)) #if (!defined(_WIN32) && !defined(__DJGPP__))
int ret_status; int ret_status;
@ -3308,7 +3417,7 @@ md_shellescape()
} }
int int
md_erasechar() md_erasechar(void)
{ {
/* /*
return(_tty.sg_erase); return(_tty.sg_erase);
@ -3318,7 +3427,7 @@ md_erasechar()
} }
int int
md_killchar() md_killchar(void)
{ {
/* /*
return(_tty.sg_kill); return(_tty.sg_kill);
@ -3362,7 +3471,7 @@ md_htonl(unsigned long int x)
} }
void void
md_init() md_init(void)
{ {
#ifdef __INTERIX #ifdef __INTERIX
char *term; char *term;
@ -3378,8 +3487,7 @@ md_init()
} }
char * char *
md_getpass(prompt) md_getpass(char *prompt)
char *prompt;
{ {
#ifdef _WIN32 #ifdef _WIN32
static char password_buffer[9]; static char password_buffer[9];
@ -3446,8 +3554,7 @@ char *prompt;
/*UNUSED*/ /*UNUSED*/
void void
tstp(a) tstp(int a)
int a;
{ {
mvcur(0, cols - 1, lines - 1, 0); mvcur(0, cols - 1, lines - 1, 0);
fflush(stdout); fflush(stdout);
@ -3462,8 +3569,8 @@ int a;
} }
#endif #endif
int void
md_setup() md_setup(void)
{ {
#ifdef SIGTSTP #ifdef SIGTSTP
signal(SIGTSTP, tstp); signal(SIGTSTP, tstp);

View file

@ -21,16 +21,15 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
void drain(int ymin, int ymax, int xmin, int xmax);
/* /*
* zap a stick and see what happens * zap a stick and see what happens
*/ */
do_zap(zapper, obj, direction, which, flags) void
struct thing *zapper; do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
struct object *obj; int flags)
coord *direction;
int which;
int flags;
{ {
register struct linked_list *item = NULL; register struct linked_list *item = NULL;
register struct thing *tp; register struct thing *tp;
@ -647,8 +646,8 @@ int flags;
* Do drain hit points from player shtick * Do drain hit points from player shtick
*/ */
drain(ymin, ymax, xmin, xmax) void
int ymin, ymax, xmin, xmax; drain(int ymin, int ymax, int xmin, int xmax)
{ {
register int i, j, count; register int i, j, count;
register struct thing *ick; register struct thing *ick;
@ -727,8 +726,8 @@ int ymin, ymax, xmin, xmax;
* initialize a stick * initialize a stick
*/ */
fix_stick(cur) void
register struct object *cur; fix_stick(struct object *cur)
{ {
if (EQUAL(ws_type[cur->o_which], "staff")) { if (EQUAL(ws_type[cur->o_which], "staff")) {
cur->o_weight = 100; cur->o_weight = 100;
@ -768,8 +767,8 @@ register struct object *cur;
* Use the wand that our monster is wielding. * Use the wand that our monster is wielding.
*/ */
m_use_wand(monster) void
register struct thing *monster; m_use_wand(struct thing *monster)
{ {
register struct object *obj; register struct object *obj;
@ -794,14 +793,16 @@ register struct thing *monster;
*/ */
msg("%s points a %s at you!", prname(monster_name(monster), TRUE), msg("%s points a %s at you!", prname(monster_name(monster), TRUE),
ws_type[obj->o_which]); ws_type[obj->o_which]);
do_zap(monster, obj, &monster->t_newpos, obj->o_which, NULL); do_zap(monster, obj, &monster->t_newpos, obj->o_which, 0);
monster->t_wand /= 2; /* chance lowers with each use */ monster->t_wand /= 2; /* chance lowers with each use */
} }
/*
* type: type of item, NULL means stick
* which: which item
*/
bool bool
need_dir(type, which) need_dir(int type, int which)
int type, /* type of item, NULL means stick */
which; /* which item */
{ {
if (type == STICK || type == 0) { if (type == STICK || type == 0) {
switch (which) { switch (which) {
@ -831,9 +832,8 @@ return (FALSE); /* hope we don't get here */
* let the player zap a stick and see what happens * let the player zap a stick and see what happens
*/ */
player_zap(which, flag) bool
int which; player_zap(int which, int flag)
int flag;
{ {
register struct linked_list *item; register struct linked_list *item;
register struct object *obj; register struct object *obj;
@ -869,7 +869,7 @@ int flag;
switch (obj->o_which) { switch (obj->o_which) {
case ORCUS_WAND: case ORCUS_WAND:
/* msg(nothing); */ /* msg(nothing); */
read_scroll(S_PETRIFY, NULL, FALSE); read_scroll(S_PETRIFY, 0, FALSE);
return(TRUE); return(TRUE);
when MING_STAFF: when MING_STAFF:
which = WS_MISSILE; which = WS_MISSILE;

View file

@ -21,13 +21,17 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
int pick_one(struct magic_item *magic, int nitems);
char *blesscurse(int flags);
char *p_kind(struct object *obj);
int extras(void);
/* /*
* print out the number of charges on a stick * print out the number of charges on a stick
*/ */
char * char *
charge_str(obj) charge_str(struct object *obj)
register struct object *obj;
{ {
static char buf[20]; static char buf[20];
@ -47,9 +51,7 @@ register struct object *obj;
*/ */
char * char *
inv_name(obj, drop) inv_name(struct object *obj, bool drop)
register struct object *obj;
bool drop;
{ {
register char *pb; register char *pb;
@ -331,8 +333,7 @@ bool drop;
*/ */
char * char *
weap_name(obj) weap_name(struct object *obj)
register struct object *obj;
{ {
switch (obj->o_type) { switch (obj->o_type) {
case WEAPON: case WEAPON:
@ -365,8 +366,8 @@ register struct object *obj;
* put something down * put something down
*/ */
drop(item) bool
struct linked_list *item; drop(struct linked_list *item)
{ {
register char ch = 0; register char ch = 0;
register struct linked_list *obj, *nobj; register struct linked_list *obj, *nobj;
@ -473,8 +474,8 @@ struct linked_list *item;
* do special checks for dropping or unweilding|unwearing|unringing * do special checks for dropping or unweilding|unwearing|unringing
*/ */
dropcheck(op) bool
register struct object *op; dropcheck(struct object *op)
{ {
int save_max; int save_max;
@ -583,9 +584,7 @@ register struct object *op;
*/ */
struct linked_list * struct linked_list *
new_thing(thing_type, allow_curse) new_thing(int thing_type, bool allow_curse)
int thing_type;
bool allow_curse;
{ {
register struct linked_list *item; register struct linked_list *item;
register struct object *cur; register struct object *cur;
@ -801,8 +800,7 @@ bool allow_curse;
*/ */
struct linked_list * struct linked_list *
spec_item(type, which, hit, damage) spec_item(int type, int which, int hit, int damage)
int type, which, hit, damage;
{ {
register struct linked_list *item; register struct linked_list *item;
register struct object *obj; register struct object *obj;
@ -877,9 +875,8 @@ int type, which, hit, damage;
* pick an item out of a list of nitems possible magic items * pick an item out of a list of nitems possible magic items
*/ */
pick_one(magic, nitems) int
register struct magic_item *magic; pick_one(struct magic_item *magic, int nitems)
int nitems;
{ {
register struct magic_item *end; register struct magic_item *end;
register int i; register int i;
@ -908,8 +905,7 @@ int nitems;
*/ */
char * char *
blesscurse(flags) blesscurse(int flags)
int flags;
{ {
if (flags & ISKNOW) { if (flags & ISKNOW) {
if (flags & ISCURSED) return("cursed "); if (flags & ISCURSED) return("cursed ");
@ -922,11 +918,11 @@ int flags;
/* /*
* p_kind returns the type of potion for some types of identified potions; * p_kind returns the type of potion for some types of identified potions;
* otherwise, it returns the color. * otherwise, it returns the color.
* We assume that obj points to a potion.
*/ */
char * char *
p_kind(obj) p_kind(struct object *obj)
struct object *obj; /* We assume that obj points to a potion */
{ {
if (obj->o_which == P_ABIL) return(abilities[obj->o_kind].w_string); if (obj->o_which == P_ABIL) return(abilities[obj->o_kind].w_string);
else return(p_colors[obj->o_which]); else return(p_colors[obj->o_which]);
@ -937,7 +933,8 @@ struct object *obj; /* We assume that obj points to a potion */
* Return the number of extra items to be created * Return the number of extra items to be created
*/ */
extras() int
extras(void)
{ {
reg int i; reg int i;

View file

@ -16,12 +16,17 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
bool open_market(void);
void trans_line(void);
char *typ_name(struct object *obj);
/* /*
* buy_it: * buy_it:
* Buy the item on which the hero stands * Buy the item on which the hero stands
*/ */
buy_it() void
buy_it(void)
{ {
reg int wh; reg int wh;
struct linked_list *item = NULL; struct linked_list *item = NULL;
@ -84,10 +89,11 @@ buy_it()
/* /*
* do_post: * do_post:
* Put a trading post room and stuff on the screen * Put a trading post room and stuff on the screen
* startup: True if equipping the player at the beginning of the game
*/ */
do_post(startup) void
bool startup; /* True if equipping the player at the beginning of the game */ do_post(bool startup)
{ {
coord tp; coord tp;
reg int i, j = 0, k; reg int i, j = 0, k;
@ -348,7 +354,8 @@ bool startup; /* True if equipping the player at the beginning of the game */
* Retruns TRUE when ok do to transacting * Retruns TRUE when ok do to transacting
*/ */
open_market() bool
open_market(void)
{ {
if (trader >= MAXPURCH && !wizard && level != 0) { if (trader >= MAXPURCH && !wizard && level != 0) {
msg("The market is closed. The stairs are that-a-way! "); msg("The market is closed. The stairs are that-a-way! ");
@ -364,7 +371,8 @@ open_market()
* Price the object that the hero stands on * Price the object that the hero stands on
*/ */
price_it() bool
price_it(void)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -404,7 +412,8 @@ price_it()
* Sell an item to the trading post * Sell an item to the trading post
*/ */
sell_it() void
sell_it(void)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -451,7 +460,8 @@ sell_it()
* Show how many transactions the hero has left * Show how many transactions the hero has left
*/ */
trans_line() void
trans_line(void)
{ {
if (level == 0) if (level == 0)
sprintf(prbuf, "You are welcome to spend whatever gold you have."); sprintf(prbuf, "You are welcome to spend whatever gold you have.");
@ -472,8 +482,7 @@ trans_line()
*/ */
char * char *
typ_name(obj) typ_name(struct object *obj)
reg struct object *obj;
{ {
static char buff[20]; static char buff[20];
reg int wh; reg int wh;

View file

@ -26,8 +26,7 @@
*/ */
int int
ac_compute(ignoremetal) ac_compute(bool ignoremetal)
bool ignoremetal;
{ {
register int ac; register int ac;
@ -60,8 +59,8 @@ bool ignoremetal;
* aggravate all the monsters on this level * aggravate all the monsters on this level
*/ */
aggravate(do_uniques, do_good) void
bool do_uniques, do_good; aggravate(bool do_uniques, bool do_good)
{ {
register struct linked_list *mi; register struct linked_list *mi;
register struct thing *thingptr; register struct thing *thingptr;
@ -78,8 +77,8 @@ bool do_uniques, do_good;
* returns true if the hero can see a certain coordinate. * returns true if the hero can see a certain coordinate.
*/ */
cansee(y, x) bool
register int y, x; cansee(int y, int x)
{ {
register struct room *rer; register struct room *rer;
register int radius; register int radius;
@ -126,7 +125,7 @@ register int y, x;
*/ */
long long
check_level() check_level(void)
{ {
register int i, j, add = 0; register int i, j, add = 0;
register unsigned long exp; register unsigned long exp;
@ -170,8 +169,8 @@ check_level()
* it keeps track of the highest it has been, just in case * it keeps track of the highest it has been, just in case
*/ */
chg_str(amt) void
register int amt; chg_str(int amt)
{ {
register int ring_str; /* ring strengths */ register int ring_str; /* ring strengths */
register struct stats *ptr; /* for speed */ register struct stats *ptr; /* for speed */
@ -195,7 +194,8 @@ register int amt;
* let's confuse the player * let's confuse the player
*/ */
confus_player() void
confus_player(void)
{ {
if (off(player, ISCLEAR)) if (off(player, ISCLEAR))
{ {
@ -213,7 +213,8 @@ confus_player()
* this routine computes the players current dexterity * this routine computes the players current dexterity
*/ */
dex_compute() int
dex_compute(void)
{ {
if (cur_misc[WEAR_GAUNTLET] != NULL && if (cur_misc[WEAR_GAUNTLET] != NULL &&
cur_misc[WEAR_GAUNTLET]->o_which == MM_G_DEXTERITY) { cur_misc[WEAR_GAUNTLET]->o_which == MM_G_DEXTERITY) {
@ -231,9 +232,8 @@ dex_compute()
* Check to see if the move is legal if it is diagonal * Check to see if the move is legal if it is diagonal
*/ */
diag_ok(sp, ep, flgptr) bool
register coord *sp, *ep; diag_ok(coord *sp, coord *ep, struct thing *flgptr)
struct thing *flgptr;
{ {
register int numpaths = 0; register int numpaths = 0;
@ -254,10 +254,7 @@ struct thing *flgptr;
*/ */
coord * coord *
fallpos(pos, be_clear, range) fallpos(coord *pos, bool be_clear, int range)
register coord *pos;
bool be_clear;
int range;
{ {
register int tried, i, j; register int tried, i, j;
register char ch; register char ch;
@ -333,8 +330,8 @@ int range;
* Find the index into the monster table of a monster given its name. * Find the index into the monster table of a monster given its name.
*/ */
findmindex(name) int
char *name; findmindex(char *name)
{ {
int which; int which;
@ -355,9 +352,7 @@ char *name;
*/ */
struct linked_list * struct linked_list *
find_mons(y, x) find_mons(int y, int x)
register int y;
register int x;
{ {
register struct linked_list *item; register struct linked_list *item;
register struct thing *th; register struct thing *th;
@ -377,9 +372,7 @@ register int x;
*/ */
struct linked_list * struct linked_list *
find_obj(y, x) find_obj(int y, int x)
register int y;
register int x;
{ {
register struct linked_list *obj; register struct linked_list *obj;
register struct object *op; register struct object *op;
@ -398,7 +391,7 @@ register int x;
*/ */
coord coord
get_coordinates() get_coordinates(void)
{ {
register int which; register int which;
coord c; coord c;
@ -458,8 +451,7 @@ get_coordinates()
*/ */
bool bool
get_dir(direction) get_dir(coord *direction)
coord *direction;
{ {
register char *prompt; register char *prompt;
register bool gotit; register bool gotit;
@ -519,8 +511,7 @@ coord *direction;
*/ */
long long
get_worth(obj) get_worth(struct object *obj)
reg struct object *obj;
{ {
reg long worth, wh; reg long worth, wh;
@ -591,8 +582,7 @@ reg struct object *obj;
*/ */
bool bool
invisible(monst) invisible(struct thing *monst)
register struct thing *monst;
{ {
register bool ret_code; register bool ret_code;
@ -608,8 +598,8 @@ register struct thing *monst;
* see if the object is one of the currently used items * see if the object is one of the currently used items
*/ */
is_current(obj) bool
register struct object *obj; is_current(struct object *obj)
{ {
if (obj == NULL) if (obj == NULL)
return FALSE; return FALSE;
@ -648,11 +638,12 @@ register struct object *obj;
/* /*
* Look: * Look:
* A quick glance all around the player * A quick glance all around the player
* wakeup: Should we wake up monsters
* runend: At end of a run -- for mazes
*/ */
look(wakeup, runend) void
bool wakeup; /* Should we wake up monsters */ look(bool wakeup, bool runend)
bool runend; /* At end of a run -- for mazes */
{ {
register int x, y, radius; register int x, y, radius;
register unsigned char ch, och; register unsigned char ch, och;
@ -937,8 +928,8 @@ bool runend; /* At end of a run -- for mazes */
* Lower a level of experience * Lower a level of experience
*/ */
lower_level(who) void
short who; lower_level(short who)
{ {
int fewer, nsides; int fewer, nsides;
unsigned long exp; unsigned long exp;
@ -975,8 +966,7 @@ short who;
*/ */
char * char *
monster_name(tp) monster_name(struct thing *tp)
register struct thing *tp;
{ {
prbuf[0] = '\0'; prbuf[0] = '\0';
if (on(*tp, ISFLEE) || on(*tp, WASTURNED)) if (on(*tp, ISFLEE) || on(*tp, WASTURNED))
@ -1007,8 +997,7 @@ register struct thing *tp;
*/ */
bool bool
move_hero(why) move_hero(int why)
int why;
{ {
char *action = NULL; char *action = NULL;
unsigned char which; unsigned char which;
@ -1053,7 +1042,8 @@ int why;
* The guy just magically went up a level. * The guy just magically went up a level.
*/ */
raise_level() void
raise_level(void)
{ {
unsigned long test; /* Next level -- be sure it is not an overflow */ unsigned long test; /* Next level -- be sure it is not an overflow */
@ -1105,12 +1095,13 @@ static const char st_matrix[NUM_CHARTYPES][5] = {
/* /*
* save: * save:
* See if a creature saves against something * See if a creature saves against something
* which: which type of save
* who: who is saving
* adj: saving throw adjustment
*/ */
save(which, who, adj) bool
int which; /* which type of save */ save(int which, struct thing *who, int adj)
struct thing *who; /* who is saving */
int adj; /* saving throw adjustment */
{ {
register int need, level, protect; register int need, level, protect;
@ -1167,8 +1158,8 @@ int adj; /* saving throw adjustment */
* Figure out what a secret door looks like. * Figure out what a secret door looks like.
*/ */
secretdoor(y, x) char
register int y, x; secretdoor(int y, int x)
{ {
register int i; register int i;
register struct room *rp; register struct room *rp;
@ -1192,7 +1183,8 @@ register int y, x;
* this routine computes the players current strength * this routine computes the players current strength
*/ */
str_compute() int
str_compute(void)
{ {
if (cur_misc[WEAR_GAUNTLET] != NULL && if (cur_misc[WEAR_GAUNTLET] != NULL &&
cur_misc[WEAR_GAUNTLET]->o_which == MM_G_OGRE) { cur_misc[WEAR_GAUNTLET]->o_which == MM_G_OGRE) {
@ -1209,9 +1201,8 @@ str_compute()
* copy string using unctrl for things * copy string using unctrl for things
*/ */
strucpy(s1, s2, len) void
register char *s1, *s2; strucpy(char *s1, char *s2, int len)
register int len;
{ {
register char *sp; register char *sp;
while (len--) while (len--)
@ -1229,8 +1220,7 @@ register int len;
*/ */
char * char *
tr_name(ch) tr_name(char ch)
char ch;
{ {
register char *s = NULL; register char *s = NULL;
@ -1263,8 +1253,7 @@ char ch;
*/ */
char * char *
vowelstr(str) vowelstr(char *str)
register char *str;
{ {
switch (*str) switch (*str)
{ {
@ -1283,8 +1272,8 @@ register char *str;
* wake up a room full (hopefully) of creatures * wake up a room full (hopefully) of creatures
*/ */
wake_room(rp) void
register struct room *rp; wake_room(struct room *rp)
{ {
register struct linked_list *item; register struct linked_list *item;
register struct thing *tp; register struct thing *tp;
@ -1302,7 +1291,8 @@ register struct room *rp;
* Do nothing but let other things happen * Do nothing but let other things happen
*/ */
waste_time() void
waste_time(void)
{ {
if (inwhgt) /* if from wghtchk then done */ if (inwhgt) /* if from wghtchk then done */
return; return;

View file

@ -21,10 +21,8 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
boomerang(ydelta, xdelta, item, tp) void
int ydelta, xdelta; boomerang(int ydelta, int xdelta, struct linked_list *item, struct thing *tp)
register struct linked_list *item;
register struct thing *tp;
{ {
register struct object *obj; register struct object *obj;
struct thing midpoint; struct thing midpoint;
@ -56,10 +54,8 @@ register struct thing *tp;
* tp other than t_pos unless we change boomerang(). * tp other than t_pos unless we change boomerang().
*/ */
do_motion(obj, ydelta, xdelta, tp) void
register struct object *obj; do_motion(struct object *obj, int ydelta, int xdelta, struct thing *tp)
register int ydelta, xdelta;
register struct thing *tp;
{ {
/* /*
@ -117,9 +113,8 @@ register struct thing *tp;
* Drop an item someplace around here. * Drop an item someplace around here.
*/ */
fall(item, pr) void
register struct linked_list *item; fall(struct linked_list *item, bool pr)
bool pr;
{ {
register struct object *obj; register struct object *obj;
register struct room *rp; register struct room *rp;
@ -171,10 +166,8 @@ bool pr;
* Does the missile hit the monster * Does the missile hit the monster
*/ */
hit_monster(y, x, obj, tp) bool
register int y, x; hit_monster(int y, int x, struct object *obj, struct thing *tp)
struct object *obj;
register struct thing *tp;
{ {
static coord mp; static coord mp;
@ -204,9 +197,8 @@ register struct thing *tp;
* Set up the initial goodies for a weapon * Set up the initial goodies for a weapon
*/ */
init_weapon(weap, type) void
register struct object *weap; init_weapon(struct object *weap, char type)
char type;
{ {
register struct init_weps *iwp; register struct init_weps *iwp;
@ -229,10 +221,8 @@ char type;
* Fire a missile in a given direction * Fire a missile in a given direction
*/ */
missile(ydelta, xdelta, item, tp) void
int ydelta, xdelta; missile(int ydelta, int xdelta, struct linked_list *item, struct thing *tp)
register struct linked_list *item;
register struct thing *tp;
{ {
register struct object *obj; register struct object *obj;
register struct linked_list *nitem; register struct linked_list *nitem;
@ -308,8 +298,7 @@ register struct thing *tp;
*/ */
char * char *
num(n1, n2) num(int n1, int n2)
register int n1, n2;
{ {
static char numbuf[LINELEN/2]; static char numbuf[LINELEN/2];
@ -329,7 +318,8 @@ register int n1, n2;
* Pull out a certain weapon * Pull out a certain weapon
*/ */
wield() void
wield(void)
{ {
register struct linked_list *item; register struct linked_list *item;
register struct object *obj, *oweapon; register struct object *obj, *oweapon;

View file

@ -20,12 +20,15 @@
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
int dress_units(struct linked_list *item);
/* /*
* take_off: * take_off:
* Get the armor off of the players back * Get the armor off of the players back
*/ */
take_off() void
take_off(void)
{ {
register struct object *obj; register struct object *obj;
register struct linked_list *item; register struct linked_list *item;
@ -74,7 +77,8 @@ take_off()
* The player wants to wear something, so let him/her put it on. * The player wants to wear something, so let him/her put it on.
*/ */
wear() void
wear(void)
{ {
register struct linked_list *item; register struct linked_list *item;
register struct object *obj; register struct object *obj;
@ -395,8 +399,8 @@ wear()
* given item of "clothing"? * given item of "clothing"?
*/ */
dress_units(item) int
struct linked_list *item; dress_units(struct linked_list *item)
{ {
register struct object *obj; register struct object *obj;

View file

@ -21,6 +21,8 @@
* under strange circumstances) * under strange circumstances)
*/ */
int getbless(void);
#include <stdlib.h> #include <stdlib.h>
#include <curses.h> #include <curses.h>
#include <ctype.h> #include <ctype.h>
@ -33,9 +35,8 @@
* Create any object for wizard, scroll, magician, or cleric * Create any object for wizard, scroll, magician, or cleric
*/ */
create_obj(prompt, which_item, which_type) void
bool prompt; create_obj(bool prompt, int which_item, int which_type)
int which_item, which_type;
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -338,7 +339,7 @@ int which_item, which_type;
*/ */
int int
getbless() getbless(void)
{ {
reg char bless; reg char bless;
@ -356,7 +357,8 @@ getbless()
* get a non-monster death type * get a non-monster death type
*/ */
getdeath() int
getdeath(void)
{ {
register int i; register int i;
int which_death; int which_death;
@ -385,11 +387,11 @@ getdeath()
/* /*
* make a monster for the wizard * make a monster for the wizard
* showall -> show uniques and genocided creatures
*/ */
makemonster(showall, action) short
bool showall; /* showall -> show uniques and genocided creatures */ makemonster(bool showall, char *action)
char *action;
{ {
register int i; register int i;
register short which_monst; register short which_monst;
@ -485,7 +487,7 @@ get_monst:
*/ */
bool bool
passwd() passwd(void)
{ {
register char *sp, c; register char *sp, c;
char buf[LINELEN]; char buf[LINELEN];
@ -522,7 +524,7 @@ passwd()
*/ */
void void
teleport() teleport(void)
{ {
register struct room *new_rp = NULL, *old_rp = roomin(&hero); register struct room *new_rp = NULL, *old_rp = roomin(&hero);
register int rm, which; register int rm, which;
@ -622,8 +624,8 @@ teleport()
* What a certin object is * What a certin object is
*/ */
whatis(what) void
struct linked_list *what; whatis(struct linked_list *what)
{ {
register struct object *obj; register struct object *obj;
register struct linked_list *item; register struct linked_list *item;
@ -686,7 +688,8 @@ struct linked_list *what;
* (if on STARTLEV equipage level = 0) * (if on STARTLEV equipage level = 0)
*/ */
choose_qst() void
choose_qst(void)
{ {
bool doit = TRUE; bool doit = TRUE;
bool escp = TRUE; bool escp = TRUE;
@ -718,7 +721,7 @@ choose_qst()
if (menu_overlay) /* Print the selections. The longest line is if (menu_overlay) /* Print the selections. The longest line is
* Hruggek (26 characters). The prompt is 21. * Hruggek (26 characters). The prompt is 21.
*/ */
over_win(cw, hw, 20, 29, 0, 21, NULL); over_win(cw, hw, 20, 29, 0, 21, '\0');
else else
draw(hw); draw(hw);