X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/77e3814f0c0e3dea4d0032e25666f77e6f83bfff..9e7fd816e02e66962d482b02209f112e1d5789fc:/monop/jail.c diff --git a/monop/jail.c b/monop/jail.c index dfad88ee..917b7a0a 100644 --- a/monop/jail.c +++ b/monop/jail.c @@ -1,6 +1,8 @@ +/* $NetBSD: jail.c,v 1.9 2008/02/24 01:57:34 dholland Exp $ */ + /* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. + * Copyright (c) 1980, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,18 +29,24 @@ * SUCH DAMAGE. */ +#include #ifndef lint -static char sccsid[] = "@(#)jail.c 5.3 (Berkeley) 6/1/90"; +#if 0 +static char sccsid[] = "@(#)jail.c 8.1 (Berkeley) 5/31/93"; +#else +__RCSID("$NetBSD: jail.c,v 1.9 2008/02/24 01:57:34 dholland Exp $"); +#endif #endif /* not lint */ -# include "monop.ext" +#include "monop.h" /* * This routine uses a get-out-of-jail-free card to get the * player out of jail. */ -card() { - +void +card() +{ if (cur_p->loc != JAIL) { printf("But you're not IN Jail\n"); return; @@ -55,24 +59,13 @@ card() { cur_p->loc = 10; /* just visiting */ cur_p->in_jail = 0; } -/* - * This routine returns the players get-out-of-jail-free card - * to a deck. - */ -ret_card(plr) -reg PLAY *plr; { - plr->num_gojf--; - if (CC_D.gojf_used) - CC_D.gojf_used = FALSE; - else - CH_D.gojf_used = FALSE; -} /* * This routine deals with paying your way out of jail. */ -pay() { - +void +pay() +{ if (cur_p->loc != JAIL) { printf("But you're not IN Jail\n"); return; @@ -82,16 +75,19 @@ pay() { cur_p->in_jail = 0; printf("That cost you $50\n"); } + /* * This routine deals with a move in jail */ +int move_jail(r1, r2) -reg int r1, r2; { - + int r1, r2; +{ if (r1 != r2) { printf("Sorry, that doesn't get you out\n"); if (++(cur_p->in_jail) == 3) { - printf("It's your third turn and you didn't roll doubles. You have to pay $50\n"); + printf("It's your third turn and you didn't roll " + "doubles. You have to pay $50\n"); cur_p->money -= 50; moveit: cur_p->loc = 10; @@ -101,14 +97,15 @@ moveit: return TRUE; } return FALSE; - } - else { + } else { printf("Double roll gets you out.\n"); goto moveit; } } -printturn() { +void +printturn() +{ if (cur_p->loc != JAIL) return; printf("(This is your ");