From 84f04a3e43c6f048b1fc46deea82f060d4a02a30 Mon Sep 17 00:00:00 2001 From: tedu Date: Thu, 9 May 2019 20:19:22 +0000 Subject: rm lists of hereditary wizards and bad users to ensure level playing field ok benno mlarkin tb --- games/battlestar/com1.c | 4 ++-- games/battlestar/com4.c | 4 ++-- games/battlestar/com6.c | 11 ++++----- games/battlestar/cypher.c | 10 ++++---- games/battlestar/extern.h | 3 +-- games/battlestar/globals.c | 3 +-- games/battlestar/init.c | 60 +--------------------------------------------- 7 files changed, 16 insertions(+), 79 deletions(-) (limited to 'games') diff --git a/games/battlestar/com1.c b/games/battlestar/com1.c index 38172eecb10..4d1a6226d36 100644 --- a/games/battlestar/com1.c +++ b/games/battlestar/com1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com1.c,v 1.15 2015/12/31 17:51:19 mestre Exp $ */ +/* $OpenBSD: com1.c,v 1.16 2019/05/09 20:19:22 tedu Exp $ */ /* $NetBSD: com1.c,v 1.3 1995/03/21 15:06:51 cgd Exp $ */ /* @@ -129,7 +129,7 @@ news(void) } rythmn = ourtime - ourtime % CYCLE; } - if (!wiz && !tempwiz) + if (!tempwiz) if ((TestBit(inven, TALISMAN) || TestBit(wear, TALISMAN)) && (TestBit(inven, MEDALION) || TestBit(wear, MEDALION)) && (TestBit(inven, AMULET) || TestBit(wear, AMULET))) { tempwiz = 1; puts("The three amulets glow and reenforce each other in power.\nYou are now a wizard."); diff --git a/games/battlestar/com4.c b/games/battlestar/com4.c index 33a9bd34ef4..b9e5b01da6a 100644 --- a/games/battlestar/com4.c +++ b/games/battlestar/com4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com4.c,v 1.15 2015/12/31 17:51:19 mestre Exp $ */ +/* $OpenBSD: com4.c,v 1.16 2019/05/09 20:19:22 tedu Exp $ */ /* $NetBSD: com4.c,v 1.3 1995/03/21 15:07:04 cgd Exp $ */ /* @@ -53,7 +53,7 @@ take(unsigned int from[]) printf("%s:\n", objsht[value]); heavy = (carrying + objwt[value]) <= WEIGHT; bulky = (encumber + objcumber[value]) <= CUMBER; - if ((TestBit(from, value) || wiz || tempwiz) && heavy && bulky && !TestBit(inven, value)) { + if ((TestBit(from, value) || tempwiz) && heavy && bulky && !TestBit(inven, value)) { SetBit(inven, value); carrying += objwt[value]; encumber += objcumber[value]; diff --git a/games/battlestar/com6.c b/games/battlestar/com6.c index f56fb08ab5a..aad08d78a5c 100644 --- a/games/battlestar/com6.c +++ b/games/battlestar/com6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com6.c,v 1.24 2018/02/07 20:22:23 tedu Exp $ */ +/* $OpenBSD: com6.c,v 1.25 2019/05/09 20:19:22 tedu Exp $ */ /* $NetBSD: com6.c,v 1.5 1995/04/27 21:30:23 mycroft Exp $ */ /* @@ -130,13 +130,10 @@ post(char ch) if (score_fp != NULL) { fprintf(score_fp, "%s %31s %c%20s", date, username, ch, rate()); - if (wiz) - fprintf(score_fp, " wizard\n"); + if (tempwiz) + fprintf(score_fp, " WIZARD!\n"); else - if (tempwiz) - fprintf(score_fp, " WIZARD!\n"); - else - fprintf(score_fp, "\n"); + fprintf(score_fp, "\n"); } sigprocmask(SIG_SETMASK, &osigset, (sigset_t *)0); } diff --git a/games/battlestar/cypher.c b/games/battlestar/cypher.c index 8ca2ac6f4d0..f7b08498dfd 100644 --- a/games/battlestar/cypher.c +++ b/games/battlestar/cypher.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cypher.c,v 1.19 2015/12/31 17:51:19 mestre Exp $ */ +/* $OpenBSD: cypher.c,v 1.20 2019/05/09 20:19:22 tedu Exp $ */ /* $NetBSD: cypher.c,v 1.3 1995/03/21 15:07:15 cgd Exp $ */ /* @@ -105,7 +105,7 @@ cypher(void) break; case UP: - if (location[position].access || wiz || tempwiz) { + if (location[position].access || tempwiz) { if (!location[position].access) puts("Zap! A gust of wind lifts you up."); if (!moveplayer(location[position].up, AHEAD)) @@ -318,7 +318,7 @@ cypher(void) break; case SU: - if (wiz || tempwiz) { + if (tempwiz) { getnum(&position, "\nRoom (was %d) = ", position); getnum(&ourtime, "Time (was %d) = ", ourtime); getnum(&fuel, "Fuel (was %d) = ", fuel); @@ -326,8 +326,8 @@ cypher(void) getnum(&CUMBER, "CUMBER (was %d) = ", CUMBER); getnum(&WEIGHT, "WEIGHT (was %d) = ", WEIGHT); getnum(&ourclock, "Clock (was %d) = ", ourclock); - if (getnum(&junk, "Wizard (was %d, %d) = ", wiz, tempwiz) != -1 && !junk) - tempwiz = wiz = 0; + if (getnum(&junk, "Wizard (was %d) = ", tempwiz) != -1 && !junk) + tempwiz = 0; printf("\nDONE.\n"); return (0); /* No commands after a SU */ } else diff --git a/games/battlestar/extern.h b/games/battlestar/extern.h index f3f1200b8bb..dddae9ceb68 100644 --- a/games/battlestar/extern.h +++ b/games/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.20 2015/12/31 17:51:19 mestre Exp $ */ +/* $OpenBSD: extern.h,v 1.21 2019/05/09 20:19:23 tedu Exp $ */ /* $NetBSD: extern.h,v 1.5 1995/04/24 12:22:18 cgd Exp $ */ /* @@ -283,7 +283,6 @@ extern int followgod; extern int godready; extern int win; extern int wintime; -extern int wiz; extern int tempwiz; extern int matchlight; extern int matchcount; diff --git a/games/battlestar/globals.c b/games/battlestar/globals.c index 25e57c18deb..c0390948286 100644 --- a/games/battlestar/globals.c +++ b/games/battlestar/globals.c @@ -1,4 +1,4 @@ -/* $OpenBSD: globals.c,v 1.15 2016/08/27 03:34:45 guenther Exp $ */ +/* $OpenBSD: globals.c,v 1.16 2019/05/09 20:19:23 tedu Exp $ */ /* $NetBSD: globals.c,v 1.3 1995/03/21 15:07:32 cgd Exp $ */ /* @@ -255,7 +255,6 @@ int snooze; int meetgirl; int godready; int wintime; -int wiz; int tempwiz; int matchlight; int loved; diff --git a/games/battlestar/init.c b/games/battlestar/init.c index 195cd498877..5c2044a918e 100644 --- a/games/battlestar/init.c +++ b/games/battlestar/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.16 2015/12/31 17:51:19 mestre Exp $ */ +/* $OpenBSD: init.c,v 1.17 2019/05/09 20:19:23 tedu Exp $ */ /* $NetBSD: init.c,v 1.4 1995/03/21 15:07:35 cgd Exp $ */ /* @@ -39,9 +39,7 @@ #include "extern.h" -static int checkout(const char *); static const char *getutmp(void); -static int wizard(const char *); void initialize(const char *filename) @@ -72,7 +70,6 @@ initialize(const char *filename) restore(savefile); free(savefile); } - wiz = wizard(username); signal(SIGINT, die); } @@ -91,58 +88,3 @@ getutmp(void) return(strdup(name)); } - -/* Hereditary wizards. A configuration file might make more sense. */ -static const char *const list[] = { - "riggle", - "chris", - "edward", - "comay", - "yee", - "dmr", - "ken", - 0 -}; - -static const char *const badguys[] = { - "wnj", - "root", - "ted", - 0 -}; - -static int -wizard(const char *username) -{ - int flag; - - if ((flag = checkout(username)) != 0) - printf("You are the Great wizard %s.\n", username); - return flag; -} - -static int -checkout(const char *username) -{ - const char *const *ptr; - - for (ptr = list; *ptr; ptr++) - if (strcmp(*ptr, username) == 0) - return 1; - for (ptr = badguys; *ptr; ptr++) - if (strcmp(*ptr, username) == 0) { - printf("You are the Poor anti-wizard %s. Good Luck!\n", - username); - if (location != NULL) { - CUMBER = 3; - WEIGHT = 9; /* that'll get him! */ - ourclock = 10; - SetBit(location[7].objects, WOODSMAN); /* viper room */ - SetBit(location[20].objects, WOODSMAN); /* laser " */ - SetBit(location[13].objects, DARK); /* amulet " */ - SetBit(location[8].objects, ELF); /* closet */ - } - return 0; /* anything else, Chris? */ - } - return 0; -} -- cgit v1.2.3-59-g8ed1b