Subject: New challenges patch
From: [email-masked] (Donald Welsh)
Date: Sun, 08 Oct 2000 16:47:34 GMT
Newsgroups: rec.games.roguelike.nethack

I've created a patch to Nethack 3.3.1, adding five new conduct
challenges.  They are as follows:

  celibate -- avoids having sex
  mute -- refrains from speaking
  nudist -- wears no armor in battle
  pauper -- doesn't handles valuables
  sober -- spurns drink and drugs

I won't spoil it for you any more than that ... yet.

Patch follows.

*** include/you.h.old	Wed Sep  6 11:49:08 2000
--- include/you.h	Sun Oct  8 17:29:40 2000
***************
*** 69,74 ****
--- 69,79 ----
  	long	polyselfs;	/* transformed yourself */
  	long	wishes;		/* used a wish */
  	long	wisharti;	/* wished for an artifact */
+ 	long	chatter;	/* talked to anyone else */
+ 	long	drunk;		/* consumed potion of booze or hallu */
+ 	long	mammon;		/* handled valuables */
+ 	long	sex;		/* consorted with foocubi */
+ 	long	textile;	/* were hit while wearing armor */
  				/* genocides already listed at end of game */
  };
  
*** src/cmd.c.old	Wed Sep  6 11:49:08 2000
--- src/cmd.c	Sun Oct  8 20:30:02 2000
***************
*** 1139,1144 ****
--- 1139,1161 ----
  			" for any artifacts");
  	}
  
+ #ifdef SEDUCE
+ 	if (!u.uconduct.sex)
+ 	    you_have_been("celibate");
+ #endif
+ 
+ 	if (!u.uconduct.chatter)
+ 	    you_have_been("mute");
+ 
+ 	if (!u.uconduct.textile)
+ 	    you_have_been("a nudist");
+ 
+ 	if (!u.uconduct.mammon)
+ 	    you_have_been("a pauper");
+ 
+ 	if (!u.uconduct.drunk)
+ 	    you_have_been("sober");
+ 
  	/* Pop up the window and wait for a key */
  	display_nhwindow(en_win, TRUE);
  	destroy_nhwindow(en_win);
*** src/eat.c.old	Wed Sep  6 11:49:08 2000
--- src/eat.c	Sun Oct  8 18:08:16 2000
***************
*** 870,875 ****
--- 870,876 ----
  		    pm == PM_VIOLET_FUNGUS) {
  			pline ("Oh wow!  Great stuff!");
  			make_hallucinated(HHallucination + 200,FALSE,0L);
+ 			u.uconduct.drunk++;
  		}
  		if(is_giant(ptr)) gainstr((struct obj *)0, 0);
  
*** src/invent.c.old	Wed Sep  6 11:49:08 2000
--- src/invent.c	Mon Oct  9 01:24:32 2000
***************
*** 272,279 ****
  
  	addinv_core1(obj);
  	/* if handed gold, we're done */
! 	if (obj->oclass == GOLD_CLASS)
  	    return obj;
  
  	/* merge if possible; find end of chain in the process */
  	for (prev = 0, otmp = invent; otmp; prev = otmp, otmp = otmp->nobj)
--- 272,287 ----
  
  	addinv_core1(obj);
  	/* if handed gold, we're done */
! 	if (obj->oclass == GOLD_CLASS) {
! 	    u.uconduct.mammon++;
  	    return obj;
+ 	}
+ 
+ 	/* allow paupers to have gray stones and precious rings */
+ 	if ((obj->oclass == GEM_CLASS) &&
+ 	    (objects[obj->otyp].oc_material == GEMSTONE ||
+ 	     objects[obj->otyp].oc_material == GLASS))
+ 		u.uconduct.mammon++;
  
  	/* merge if possible; find end of chain in the process */
  	for (prev = 0, otmp = invent; otmp; prev = otmp, otmp = otmp->nobj)
*** src/mhitu.c.old	Wed Sep  6 11:49:08 2000
--- src/mhitu.c	Sun Oct  8 22:59:06 2000
***************
*** 789,794 ****
--- 789,801 ----
  	struct permonst *olduasmon = youmonst.data;
  	int res;
  
+ 	if (uarm  ||
+ #ifdef TOURIST
+ 	    uarmu ||
+ #endif
+ 	    uarmc || uarmh || uarms || uarmg || uarmf)
+ 		u.uconduct.textile++;
+ 
  	if (!canspotmon(mtmp))
  	    map_invisible(mtmp->mx, mtmp->my);
  
***************
*** 1991,1996 ****
--- 1998,2005 ----
  
  	if (Blind) pline("It caresses you...");
  	else You_feel("very attracted to %s.", mon_nam(mon));
+ 
+ 	u.uconduct.sex++;
  
  	for(ring = invent; ring; ring = nring) {
  	    nring = ring->nobj;
*** src/minion.c.old	Wed Sep  6 11:49:08 2000
--- src/minion.c	Sun Oct  8 22:46:58 2000
***************
*** 180,185 ****
--- 180,188 ----
  	} else You("give %s %ld zorkmid%s.", mon_nam(mtmp), offer,
  		   plur(offer));
  
+ 	if (offer > 0L)
+ 		u.uconduct.mammon++;
+ 
  	u.ugold -= offer;
  	mtmp->mgold += offer;
  	flags.botl = 1;
*** src/pickup.c.old	Wed Sep  6 11:49:10 2000
--- src/pickup.c	Sun Oct  8 19:44:46 2000
***************
*** 1031,1036 ****
--- 1031,1037 ----
  		u.ugold += gold_capacity;
  		obj->quan -= gold_capacity;
  		costly_gold(obj->ox, obj->oy, gold_capacity);
+ 		u.uconduct.mammon++;
  	    } else {
  		u.ugold += count;
  		if ((nearload = near_capacity()) != 0)
***************
*** 1045,1050 ****
--- 1046,1052 ----
  		    delobj(obj);
  		else
  		    obj->quan -= count;
+ 		u.uconduct.mammon++;
  	    }
  	    flags.botl = 1;
  	    if (flags.run) nomul(0);
***************
*** 1675,1680 ****
--- 1677,1683 ----
  
  	if (is_gold) {
  		dealloc_obj(obj);
+ 		u.uconduct.mammon++;
  		bot();	/* update character's gold piece count immediately */
  	}
  	return 1;
*** src/potion.c.old	Wed Sep  6 11:49:10 2000
--- src/potion.c	Sun Oct  8 18:06:02 2000
***************
*** 372,377 ****
--- 372,378 ----
  		make_hallucinated(itimeout_incr(HHallucination,
  					   rn1(200, 600 - 300 * bcsign(otmp))),
  				  TRUE, 0L);
+ 		u.uconduct.drunk++;
  		break;
  	case POT_WATER:
  		if(!otmp->blessed && !otmp->cursed) {
***************
*** 438,443 ****
--- 439,445 ----
  			multi = -rnd(15);
  			nomovemsg = "You awake with a headache.";
  		}
+ 		u.uconduct.drunk++;
  		break;
  	case POT_ENLIGHTENMENT:
  		if(otmp->cursed) {
*** src/pray.c.old	Wed Sep  6 11:49:10 2000
--- src/pray.c	Sun Oct  8 20:24:54 2000
***************
*** 1384,1389 ****
--- 1384,1390 ----
  		if (yn("Are you sure you want to pray?") == 'n')
  			return (0);
  	u.uconduct.gnostic++;
+ 	u.uconduct.chatter++;
  
      /* set up p_type and p_alignment */
      if (!can_pray(TRUE)) return 0;
*** src/shk.c.old	Wed Sep  6 11:49:10 2000
--- src/shk.c	Sun Oct  8 22:42:30 2000
***************
*** 725,730 ****
--- 725,731 ----
  
  	u.ugold -= balance;
  	shkp->mgold += balance;
+ 	u.uconduct.mammon++;
  	flags.botl = 1;
  	if(robbed) {
  		robbed -= tmp;
***************
*** 2285,2290 ****
--- 2286,2293 ----
  	}
  
  	if(isgold || cgold) {
+ 		u.uconduct.mammon++;
+ 
  		if(!cgold) gltmp = obj->quan;
  
  		if(eshkp->debit >= gltmp) {
***************
*** 2352,2357 ****
--- 2355,2361 ----
  		    c = 'n';
  
  		if (c == 'y') {
+ 		    u.uconduct.mammon++;
  		    shk_names_obj(shkp, obj, sell_voluntarily ?
  			    "traded %s for %ld zorkmid%s in %scredit." :
  			"relinquish %s and acquire %ld zorkmid%s in %scredit.",
***************
*** 2390,2396 ****
  			    subfrombill(obj, shkp);
  			    break;
  		 case 'a':  sell_response = 'y';
! 		 case 'y':  if (container)
  				dropped_container(obj, shkp, TRUE);
  			    if (!obj->unpaid && !saleitem) obj->no_charge = 1;
  			    subfrombill(obj, shkp);
--- 2394,2401 ----
  			    subfrombill(obj, shkp);
  			    break;
  		 case 'a':  sell_response = 'y';
! 		 case 'y':  u.uconduct.mammon++;
! 		 	    if (container)
  				dropped_container(obj, shkp, TRUE);
  			    if (!obj->unpaid && !saleitem) obj->no_charge = 1;
  			    subfrombill(obj, shkp);
***************
*** 3489,3494 ****
--- 3494,3500 ----
  	shkp = shop_keeper(*in_rooms(x, y, SHOPBASE));
  
  	eshkp = ESHK(shkp);
+ 	u.uconduct.mammon++;
  	if(eshkp->credit >= amount) {
  	    if(eshkp->credit > amount)
  		Your("credit is reduced by %ld zorkmid%s.",
*** src/sounds.c.old	Wed Sep  6 11:49:10 2000
--- src/sounds.c	Sun Oct  8 23:23:14 2000
***************
*** 842,847 ****
--- 842,848 ----
  	   (not angry) and able (not asleep) to speak and the position contains
  	   any objects other than just gold.
  	*/
+ 	u.uconduct.chatter++;
  	price_quote(otmp);
  	return(1);
      }
***************
*** 849,856 ****
      (void) getdir("Talk to whom? [in what direction]");
  
  #ifdef STEED
!     if (u.usteed && u.dz > 0)
  	return (domonnoise(u.usteed));
  #endif
      if (u.dz) {
  	pline("They won't hear you %s there.", u.dz < 0 ? "up" : "down");
--- 850,859 ----
      (void) getdir("Talk to whom? [in what direction]");
  
  #ifdef STEED
!     if (u.usteed && u.dz > 0) {
!         u.uconduct.chatter;
  	return (domonnoise(u.usteed));
+     }
  #endif
      if (u.dz) {
  	pline("They won't hear you %s there.", u.dz < 0 ? "up" : "down");
***************
*** 894,899 ****
--- 897,906 ----
  	pline("%s is eating noisily.", Monnam(mtmp));
  	return (0);
      }
+ 
+     /* mutes are allowed to talk to quest leader */
+     if (mtmp->data->msound != MS_LEADER)
+ 	u.uconduct.chatter++;
  
      return domonnoise(mtmp);
  }
*** src/u_init.c.old	Wed Sep  6 11:49:10 2000
--- src/u_init.c	Sun Oct  8 23:53:54 2000
***************
*** 846,851 ****
--- 846,854 ----
  		break;
  	}
  
+ 	/* starting inventory doesn't count against pauper conduct */
+ 	u.uconduct.mammon = 0L;
+ 
  	return;
  }
  
*** src/uhitm.c.old	Wed Sep  6 11:49:10 2000
--- src/uhitm.c	Sun Oct  8 22:50:46 2000
***************
*** 1211,1216 ****
--- 1211,1217 ----
  		break;
  	    case AD_SGLD:
  		if (mdef->mgold) {
+ 		    u.uconduct.mammon++;
  		    u.ugold += mdef->mgold;
  		    mdef->mgold = 0;
  		    Your("purse feels heavier.");

-- end of forwarded message --

-- 
J. Ali Harlow                              Email: [email-masked]
    "When I consider your heavens, the work of your fingers, the moon and
     the stars, which you have set in place, what is man that you are mindful
     of him, the son of man that you care for him?"      Psalm 8 v 3-4, NIV.