[rec.games.hack] BUGFIXES for Grenade patch

richd@sci.UUCP (Rich doherty) (01/29/88)

These grenade bugfixes fix the following three bugs:

1) Stephen Linhart pointed out that blind people would not get further
   blinded by the grenade blast.  This is fixed, and now they are
   only "pounded by the blast".

2) Mark Purtill pointed out a real bug -- in the resist code, I
   used otmp->olet instead of obj->olet.  Turns out the best thing to
   use is simply '('.

3) Grenades were intended to be found in small quantities, but it turns
   out they were only found singly.  This is fixed.  

An amusing aside for readers of comp.lang.c:  Bug #3 was a result of
typing == instead of =.  I have been programming in C for about 2 years
and programming in general since the womb, and this is the first time
that this has happened to me.  I remember thinking that = and == seemed 
like a silly way to do it, but no big deal.  (I had been previously
programming in Pascal [ := and = ] and Smalltalk [ <- and == (sort of)]).
No preaching, but somehow I have renewed my mild dislike of a language
that spurns most forms of code verification.

-------------------------------------------------------------
*** archive/apply.c	Fri Jan 15 00:15:18 1988
--- apply.c	Sun Jan 17 17:33:28 1988
***************
*** 355,360
  		if (!explode)
  			goto fullcurse;
  superdamage:
  		pline("You are beaten and blinded by the blast!");
  		u.uhpmax -= ((damage < 4) ? 2 : (int)(damage/2));
  		if (u.uhpmax < 2) u.uhpmax = 2;

--- 355,363 -----
  		if (!explode)
  			goto fullcurse;
  superdamage:
+ 		if (Blinded || Blindfolded)
+ 			pline("You are pounded by the blast!");
+ 		else
  			pline("You are beaten and blinded by the blast!");
  		u.uhpmax -= ((damage < 4) ? 2 : (int)(damage/2));
  		if (u.uhpmax < 2) u.uhpmax = 2;
***************
*** 360,365
  		if (u.uhpmax < 2) u.uhpmax = 2;
  		losehp(2*damage + 10,"exploding grenade");
  		HConfusion += 2*damage;
  		doblind = 3*damage;
  		burn_scrolls();
  		boil_potions();

--- 363,369 -----
  		if (u.uhpmax < 2) u.uhpmax = 2;
  		losehp(2*damage + 10,"exploding grenade");
  		HConfusion += 2*damage;
+ 		if (!Blindfolded)
  			doblind = 3*damage;
  		burn_scrolls();
  		boil_potions();
***************
*** 397,402
  	{
  		pline("%s at your feet!",exptxt);
  bigdamage:
  		pline("You are beaten and blinded by the blast!");
  		if (explode)
  		{	u.uhpmax -= ((damage < 3) ? 1 : (int)(damage / 3));

--- 401,409 -----
  	{
  		pline("%s at your feet!",exptxt);
  bigdamage:
+ 		if (Blinded || Blindfolded)
+ 			pline("You are pounded by the blast!");
+ 		else
  			pline("You are beaten and blinded by the blast!");
  		if (explode)
  		{	u.uhpmax -= ((damage < 3) ? 1 : (int)(damage / 3));
***************
*** 403,408
  			if (u.uhpmax < 2) u.uhpmax = 2;
  			losehp(2*damage,"exploding grenade");
  			HConfusion += 2*damage;
  			doblind = 2*damage;
  			flags.botl = 1;
  		}

--- 410,416 -----
  			if (u.uhpmax < 2) u.uhpmax = 2;
  			losehp(2*damage,"exploding grenade");
  			HConfusion += 2*damage;
+ 			if (!Blindfolded)
  			doblind = 2*damage;
  			flags.botl = 1;
  		}
***************
*** 448,454
  			}
  			else if (explode)
  				mtmp->mhp -= damage;
! 			else if (!resist(mtmp,otmp->olet, 0, NOTELL))
  				mtmp->mcan = 1;
  			if (mtmp->mhp < 1)
  			{	if (mon == mtmp)

--- 456,462 -----
  			}
  			else if (explode)
  				mtmp->mhp -= damage;
! 			else if (!resist(mtmp,'(', 0, NOTELL))
  				mtmp->mcan = 1;
  			if (mtmp->mhp < 1)
  			{	if (mon == mtmp)
*** archive/mkobj.c	Mon Jan 18 22:55:16 1988
--- mkobj.c	Mon Jan 18 22:54:32 1988
***************
*** 131,137
  	case TOOL_SYM:
  #ifdef DOGRENADE
  		if (otmp->otyp == GRENADE)
! 		{	otmp->quan == rn2(4) ? rn1(4,2) : 1;
  			if (!rn2(8)) otmp->spe = rne(2);
  			else if (!rn2(10)) {
  				otmp->cursed = 1;

--- 131,137 -----
  	case TOOL_SYM:
  #ifdef DOGRENADE
  		if (otmp->otyp == GRENADE)
! 		{	otmp->quan = rn2(4) ? rn1(4,2) : 1;
  			if (!rn2(8)) otmp->spe = rne(2);
  			else if (!rn2(10)) {
  				otmp->cursed = 1;
***************
*** 140,146
  			break;
  		}
  		else if (otmp->otyp == CANCELLATION_GRENADE)
! 		{	otmp->quan == rn2(3) ? rn1(2,2) : 1;
  			otmp->spe = 1;
  			if (!rn2(10)) otmp->cursed = 1;
  			break;

--- 140,146 -----
  			break;
  		}
  		else if (otmp->otyp == CANCELLATION_GRENADE)
! 		{	otmp->quan = rn2(3) ? rn1(2,2) : 1;
  			otmp->spe = 1;
  			if (!rn2(10)) otmp->cursed = 1;
  			break;
-- 
-------------------------------------------------
"I have no ambition whatsoever, except to turn my life
 into successful entertainment"  -- Jean Anouilh

casey@lll-crg.llnl.gov (Casey Leedom) (01/30/88)

  Grenades.  So when are we going to get the laser pistols and plasma
rifles?  Are these weapons really in the spirit of the game?  Does the
game have a spirit?  Oh well, not really saying that I object, just
pointing out that grenades seem to tread on the thin line of magic and
fantasy.

  By the way, instead of all these really niggling little changes, why
doesn't someone bite the bullet and make a real change.  Either real time
play or multi-player would be a quantum jump in functionality.  I mean,
the depth of feel that all these detailed and filigreed features add to
hack is nice, but sooner or later you have to add something real.

Casey