diff options
Diffstat (limited to 'hack/hack.shk.c')
-rw-r--r-- | hack/hack.shk.c | 110 |
1 files changed, 42 insertions, 68 deletions
diff --git a/hack/hack.shk.c b/hack/hack.shk.c index 6f6abc45..c24ecdc4 100644 --- a/hack/hack.shk.c +++ b/hack/hack.shk.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.shk.c,v 1.8 2006/03/30 01:32:27 jnemeth Exp $ */ +/* $NetBSD: hack.shk.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hack.shk.c,v 1.8 2006/03/30 01:32:27 jnemeth Exp $"); +__RCSID("$NetBSD: hack.shk.c,v 1.9 2009/06/07 18:30:39 dholland Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -86,73 +86,64 @@ int shlevel = 0; struct monst *shopkeeper = 0; struct obj *billobjs = 0; void -obfree(obj, merge) - struct obj *obj, *merge; +obfree(struct obj *obj, struct obj *merge) { free((char *) obj); } int -inshop() { +inshop(void) { return (0); } void -shopdig(n) - int n; +shopdig(int n) { } void -addtobill(obj) - struct obj *obj; +addtobill(struct obj *obj) { } void -subfrombill(obj) - struct obj *obj; +subfrombill(struct obj *obj) { } void -splitbill(o1, o2) - struct obj *o1, *o2; +splitbill(struct obj *o1, struct obj *o2) { } int -dopay() { +dopay(void) +{ return (0); } void -paybill() +paybill(void) { } int -doinvbill(n) - int n; +doinvbill(int n) { return (0); } void -shkdead(m) - struct monst *m; +shkdead(struct monst *m) { } int -shkcatch(obj) - struct obj *obj; +shkcatch(struct obj *obj) { return (0); } int -shk_move(m) - struct monst *m; +shk_move(struct monst *m) { return (0); } void -replshk(mtmp, mtmp2) - struct monst *mtmp, *mtmp2; +replshk(struct monst *mtmp, struct monst *mtmp2) { } -char *shkname(m) - struct monst *m; +char * +shkname(struct monst *m) { return (""); } @@ -196,15 +187,13 @@ static const char *const shopnam[] = { }; char * -shkname(mtmp) /* called in do_name.c */ - struct monst *mtmp; +shkname(struct monst *mtmp) /* called in do_name.c */ { return (ESHK(mtmp)->shknam); } void -shkdead(mtmp) /* called in mon.c */ - struct monst *mtmp; +shkdead(struct monst *mtmp) /* called in mon.c */ { struct eshk *eshk = ESHK(mtmp); @@ -219,8 +208,7 @@ shkdead(mtmp) /* called in mon.c */ } void -replshk(mtmp, mtmp2) - struct monst *mtmp, *mtmp2; +replshk(struct monst *mtmp, struct monst *mtmp2) { if (mtmp == shopkeeper) { shopkeeper = mtmp2; @@ -229,7 +217,7 @@ replshk(mtmp, mtmp2) } static void -setpaid() +setpaid(void) { /* caller has checked that shopkeeper exists */ /* either we paid or left the shop or he just died */ struct obj *obj; @@ -254,7 +242,7 @@ setpaid() } static void -addupbill() +addupbill(void) { /* delivers result in total */ /* caller has checked that shopkeeper exists */ int ct = ESHK(shopkeeper)->billct; @@ -267,7 +255,7 @@ addupbill() } int -inshop() +inshop(void) { int roomno = inroom(u.ux, u.uy); @@ -360,8 +348,7 @@ inshop() } static void -findshk(roomno) - int roomno; +findshk(int roomno) { struct monst *mtmp; for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) @@ -389,8 +376,7 @@ findshk(roomno) } static struct bill_x * -onbill(obj) - struct obj *obj; +onbill(struct obj *obj) { struct bill_x *bp; if (!shopkeeper) @@ -408,8 +394,7 @@ onbill(obj) /* called with two args on merge */ void -obfree(obj, merge) - struct obj *obj, *merge; +obfree(struct obj *obj, struct obj *merge) { struct bill_x *bp = onbill(obj); struct bill_x *bpm; @@ -437,9 +422,7 @@ obfree(obj, merge) } static void -pay(tmp, shkp) - long tmp; - struct monst *shkp; +pay(long tmp, struct monst *shkp) { long robbed = ESHK(shkp)->robbed; @@ -455,7 +438,7 @@ pay(tmp, shkp) } int -dopay() +dopay(void) { long ltmp; struct bill_x *bp; @@ -577,8 +560,7 @@ dopay() /* 0 if not enough money */ /* -1 if object could not be found (but was paid) */ static int -dopayobj(bp) - struct bill_x *bp; +dopayobj(struct bill_x *bp) { struct obj *obj; long ltmp; @@ -627,7 +609,7 @@ dopayobj(bp) /* routine called after dying (or quitting) with nonempty bill */ void -paybill() +paybill(void) { if (shlevel == dlevel && shopkeeper && ESHK(shopkeeper)->billct) { addupbill(); @@ -648,8 +630,7 @@ paybill() /* find obj on one of the lists */ struct obj * -bp_to_obj(bp) - struct bill_x *bp; +bp_to_obj(struct bill_x *bp) { struct obj *obj; struct monst *mtmp; @@ -672,8 +653,7 @@ bp_to_obj(bp) /* called in hack.c when we pickup an object */ void -addtobill(obj) - struct obj *obj; +addtobill(struct obj *obj) { struct bill_x *bp; if (!inshop() || @@ -696,8 +676,7 @@ addtobill(obj) } void -splitbill(obj, otmp) - struct obj *obj, *otmp; +splitbill(struct obj *obj, struct obj *otmp) { /* otmp has been split off from obj */ struct bill_x *bp; @@ -730,8 +709,7 @@ splitbill(obj, otmp) } void -subfrombill(obj) - struct obj *obj; +subfrombill(struct obj *obj) { long ltmp; int tmp; @@ -796,9 +774,9 @@ subfrombill(obj) plur(ltmp)); } +/* mode: 0: deliver count 1: paged */ int -doinvbill(mode) - int mode; /* 0: deliver count 1: paged */ +doinvbill(int mode) { struct bill_x *bp; struct obj *obj; @@ -859,8 +837,7 @@ quit: } static int -getprice(obj) - struct obj *obj; +getprice(struct obj *obj) { int tmp, ac; @@ -920,7 +897,7 @@ getprice(obj) } static int -realhunger() +realhunger(void) { /* not completely foolproof */ int tmp = u.uhunger; struct obj *otmp = invent; @@ -933,8 +910,7 @@ realhunger() } int -shkcatch(obj) - struct obj *obj; +shkcatch(struct obj *obj) { struct monst *shkp = shopkeeper; @@ -955,8 +931,7 @@ shkcatch(obj) * shk_move: return 1: he moved 0: he didnt -1: let m_move do it */ int -shk_move(shkp) - struct monst *shkp; +shk_move(struct monst *shkp) { struct monst *mtmp; const struct permonst *mdat = shkp->data; @@ -1159,8 +1134,7 @@ online(int x, int y) /* Does this monster follow me downstairs? */ int -follower(mtmp) - struct monst *mtmp; +follower(struct monst *mtmp) { return (mtmp->mtame || strchr("1TVWZi&, ", mtmp->data->mlet) #ifndef QUEST |