From fortune!hpda!hplabs!tektronix!uw-beaver!cornell!pugh Thu May 16 10:58:42 1985 Relay-Version: version B 2.10.2 9/18/84; site wdl1.UUCP Posting-Version: version B 2.10.2 9/18/84; site cornell.UUCP Path: wdl1!fortune!hpda!hplabs!tektronix!uw-beaver!cornell!pugh From: pugh@cornell.UUCP (William Pugh) Newsgroups: net.games.hack Subject: Re: Hack modifications Message-ID: <1783@cornell.UUCP> Date: 16 May 85 17:58:42 GMT Article-I.D.: cornell.1783 Posted: Thu May 16 10:58:42 1985 Date-Received: 22 May 85 05:02:08 GMT References: <1713@cornell.UUCP> Reply-To: pugh@gvax.UUCP (William Pugh) Distribution: net Organization: Cornell Univ. CS Dept. Lines: 46 Summary: ----- Here are the changes to keep you from attacking your dog. It totally prevents you from attacking your dog, and if you attempt to attack any peaceful creature, it verifies that you really want to attack. You could just leave out the first part of these changes and the program would simply verify that you wanted to attack your dog before allowing you to do it. Note that if you are blind or confused, you do not get this protection. I think the fflush will serve to flush any type-ahead, but I'm not sure... Bill Pugh Cornell University hack.fight.c, changes inserted at line 4: #include "hack.h" >#include hack.fight.c, changes inserted at line 259: if(mdat->mlet == 'L' && !mtmp->mfroz && !mtmp->msleep && !mtmp->mconf && mtmp->mcansee && !rn2(7) && (m_move(mtmp, 0) == 2 /* he died */ || /* he moved: */ mtmp->mx != u.ux+u.dx || mtmp->my != u.uy+u.dy)) return(FALSE); > /* changes by wwp 5/16/85 */ > if (!Blind && Confusion == 0 && mdat->mlet == 'd' && mtmp->mtame) { > mtmp->mflee = 1; > mtmp->mfleetim = rnd(6); > pline("You stop to avoid hitting your dog"); > return(TRUE); > } > if (!Blind && Confusion == 0 && (mtmp->mpeaceful || mtmp->mtame)) { > (void) fflush(stdin); > pline("Really attack?"); > (void) fflush(stdout); > if (readchar() != 'y') return(TRUE); > } if(mtmp->mimic){ if(!u.ustuck && !mtmp->mflee) u.ustuck = mtmp; switch(levl[u.ux+u.dx][u.uy+u.dy].scrsym){