X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/1c987590202c8ca8dec65a88afd1d73328d55b39..d83ae3073815d24b7f25631da96992bf92984230:/rogue/ring.c diff --git a/rogue/ring.c b/rogue/ring.c index 321fd493..5cdcf5fb 100644 --- a/rogue/ring.c +++ b/rogue/ring.c @@ -1,4 +1,4 @@ -/* $NetBSD: ring.c,v 1.7 2007/12/27 23:53:00 dholland Exp $ */ +/* $NetBSD: ring.c,v 1.9 2008/01/14 03:50:02 dholland Exp $ */ /* * Copyright (c) 1988, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)ring.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: ring.c,v 1.7 2007/12/27 23:53:00 dholland Exp $"); +__RCSID("$NetBSD: ring.c,v 1.9 2008/01/14 03:50:02 dholland Exp $"); #endif #endif /* not lint */ @@ -55,8 +55,9 @@ __RCSID("$NetBSD: ring.c,v 1.7 2007/12/27 23:53:00 dholland Exp $"); #include "rogue.h" -const char *left_or_right = "left or right hand?"; -const char *no_ring = "there's no ring on that hand"; +static const char left_or_right[] = "left or right hand?"; +static const char no_ring[] = "there's no ring on that hand"; + short stealthy; short r_rings; short add_strength; @@ -70,7 +71,7 @@ boolean sustain_strength; boolean maintain_armor; void -put_on_ring() +put_on_ring(void) { short ch; char desc[DCOLS]; @@ -122,7 +123,7 @@ put_on_ring() check_message(); get_desc(ring, desc, sizeof(desc)); messagef(0, "%s", desc); - (void) reg_move(); + (void)reg_move(); } /* @@ -131,9 +132,7 @@ put_on_ring() */ void -do_put_on(ring, on_left) - object *ring; - boolean on_left; +do_put_on(object *ring, boolean on_left) { if (on_left) { ring->in_use_flags |= ON_LEFT_HAND; @@ -145,7 +144,7 @@ do_put_on(ring, on_left) } void -remove_ring() +remove_ring(void) { boolean left = 0, right = 0; short ch; @@ -189,29 +188,26 @@ remove_ring() un_put_on(ring); get_desc(ring, buf, sizeof(buf)); messagef(0, "removed %s", buf); - (void) reg_move(); + (void)reg_move(); } } } void -un_put_on(ring) - object *ring; +un_put_on(object *ring) { if (ring && (ring->in_use_flags & ON_LEFT_HAND)) { ring->in_use_flags &= (~ON_LEFT_HAND); - rogue.left_ring = 0; + rogue.left_ring = NULL; } else if (ring && (ring->in_use_flags & ON_RIGHT_HAND)) { ring->in_use_flags &= (~ON_RIGHT_HAND); - rogue.right_ring = 0; + rogue.right_ring = NULL; } ring_stats(1); } void -gr_ring(ring, assign_wk) - object *ring; - boolean assign_wk; +gr_ring(object *ring, boolean assign_wk) { ring->what_is = RING; if (assign_wk) { @@ -241,7 +237,8 @@ gr_ring(ring, assign_wk) break; case ADD_STRENGTH: case DEXTERITY: - while ((ring->class = (get_rand(0, 4) - 2)) == 0) ; + while ((ring->class = (get_rand(0, 4) - 2)) == 0) + ; ring->is_cursed = (ring->class < 0); break; case ADORNMENT: @@ -251,7 +248,7 @@ gr_ring(ring, assign_wk) } void -inv_rings() +inv_rings(void) { char buf[DCOLS]; @@ -276,8 +273,7 @@ inv_rings() } void -ring_stats(pr) - boolean pr; +ring_stats(boolean pr) { short i; object *ring;