🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.games.hack
Article #719

1.0.2 dog and cockatrice fix

#719
From: Latitudinarian Lobster
Date: Wed, 05 Jun 1985 00:12
98 lines
3398 bytes
I've hacked hack so that dogs will avoid spots with a dead cockatrice and
will also refuse to pick one up if the dog happens to be there for some
reason (like tripe).  The following context diff also contains a couple
older fixes.


*** hack.dog.c.old	Fri Apr 26 13:51:29 1985
--- hack.dog.c	Tue Jun  4 19:04:45 1985
***************
*** 142,147
  	dogroom = inroom(omx,omy);
  	uroom = inroom(u.ux,u.uy);
  	udist = dist(omx,omy);
  
  	/* if we are carrying sth then we drop it (perhaps near @) */
  	/* Note: if apport == 1 then our behaviour is independent of udist */

--- 142,148 -----
  	dogroom = inroom(omx,omy);
  	uroom = inroom(u.ux,u.uy);
  	udist = dist(omx,omy);
+ 	if (udist == 0) return(0);			/* aeb */
  
  	/* if we are carrying sth then we drop it (perhaps near @) */
  	/* Note: if apport == 1 then our behaviour is independent of udist */
***************
*** 150,155
  		if(rn2(10) < edog->apport){
  			relobj(mtmp, (int) mtmp->minvis);
  			if(edog->apport > 1) edog->apport--;
  		}
  	} else {
  		if(obj = o_at(omx,omy)) if(!index("0_", obj->olet)){

--- 151,158 -----
  		if(rn2(10) < edog->apport){
  			relobj(mtmp, (int) mtmp->minvis);
  			if(edog->apport > 1) edog->apport--;
+   			edog->dropdist = udist;		/* hpscdi!jon */
+   			edog->droptime = moves;
  		}
  	} else {
  		if(obj = o_at(omx,omy))
***************
*** 152,158
  			if(edog->apport > 1) edog->apport--;
  		}
  	} else {
! 		if(obj = o_at(omx,omy)) if(!index("0_", obj->olet)){
  		    if((otyp = dogfood(obj)) <= CADAVER){
  			nix = omx;
  			niy = omy;

--- 155,162 -----
    			edog->droptime = moves;
  		}
  	} else {
! 		if(obj = o_at(omx,omy))
! 		if(!index("0_", obj->olet) && !(obj->otyp == DEAD_COCKATRICE)){
  		    if((otyp = dogfood(obj)) <= CADAVER){
  			nix = omx;
  			niy = omy;
***************
*** 283,289
  			if(rn2(10)) continue;
  		}
  
! 		/* dog eschewes cursed objects */
  		/* but likes dog food */
  		obj = fobj;
  		while(obj){

--- 287,293 -----
  			if(rn2(10)) continue;
  		}
  
! 		/* dog eschewes cursed objects and dead cockatrices */
  		/* but likes dog food */
  		obj = fobj;
  		while(obj){
***************
*** 289,295
  		while(obj){
  		    if(obj->ox != nx || obj->oy != ny)
  			goto nextobj;
! 		    if(obj->cursed) goto nxti;
  		    if(obj->olet == FOOD_SYM &&
  			(otyp = dogfood(obj)) < MANFOOD &&
  			(otyp < ACCFOOD || edog->hungrytime <= moves)){

--- 293,299 -----
  		while(obj){
  		    if(obj->ox != nx || obj->oy != ny)
  			goto nextobj;
! 		    if( (obj->cursed) || (obj->otyp == DEAD_COCKATRICE) ) goto nxti;
  		    if(obj->olet == FOOD_SYM &&
  			(otyp = dogfood(obj)) < MANFOOD &&
  			(otyp < ACCFOOD || edog->hungrytime <= moves)){
Technical Details
Message-ID: <1186@uwmacc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!mcnc!philabs!cmcl2!seismo!uwvax!uwmacc!myers

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site uwmacc.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!mcnc!philabs!cmcl2!seismo!uwvax!uwmacc!myers
From: myers@uwmacc.UUCP (Latitudinarian Lobster)
Newsgroups: net.games.hack
Subject: 1.0.2 dog and cockatrice fix
Message-ID: <1186@uwmacc.UUCP>
Date: Tue, 4-Jun-85 20:12:30 EDT
Article-I.D.: uwmacc.1186
Posted: Tue Jun  4 20:12:30 1985
Date-Received: Thu, 6-Jun-85 06:51:03 EDT
Distribution: net
Organization: UWisconsin-Madison Academic Comp Center
Lines: 98