« Return to Thread: Patch: Eggs in cockatrice nests

Patch: Eggs in cockatrice nests

by Silas Dunsmore :: Rate this Message:

Reply to Author | View in Thread

Presented for discussion and possible inclusion in Slash'EM.

This patch has also been submitted to the SourceForge tracker.

This patch adds the occasional cockatrice egg to cockatrice nests.  A
small nest of 3x4 will average one egg, while a large nest of 6x7 will
average between three and four eggs.  

Spoilers follow!


These eggs will soon hatch, so there is a motivation for the player to
quickly slaughter the nest to get the eggs.

Analysis: this patch makes things harder for the beginner (with a greater
availability of an object that can cause insta-death; u_gname() help the
unfortunate character who eats one...) and easier for the expert or
spoiled player (cockatrice eggs are great weapons, and these ones weren't
laid by the character, so don't carry the luck malus).

This patch applies cleanly to Slashem 0.0.8E0F1.

The new code in this patch is contributed by the author, Silas Dunsmore,
to the Slash'EM project, and to the general Nethack community, under the
terms of the Nethack General Public License.

contact: <silasd@...>; put slashem or nethack in the subject line.
===============================================================================
--- slashem-0.0.8E0F1-clean/src/mkroom.c 2006-12-30 05:04:53.000000000 -0800
+++ slashem-0.0.8E0F1/src/mkroom.c 2007-08-10 22:48:27.191270300 -0700
@@ -421,10 +421,25 @@
     (void) add_to_container(sobj,
  mkobj(RANDOM_CLASS, FALSE));
  sobj->owt = weight(sobj);
     }
  }
+ /* new code */
+ else if (!rn2(8)) {  /* 2/3 * 1/8 = 1 chance in 12 */
+    int mndx = can_be_hatched(PM_COCKATRICE);
+    if (mndx != NON_PM && !dead_species(mndx, TRUE)) {
+ struct obj *otmp;
+ otmp = mksobj_at(EGG, sx, sy, FALSE, FALSE);
+ if (otmp) {
+    otmp->corpsenm = mndx;
+    /* hatch 2in3; normally eggs hatch 1in3 */
+    if (rn2(3))
+ attach_egg_hatch_timeout(otmp);
+ }
+    }
+ }
+ /* end new code */
  break;
     case ANTHOLE:
  if(!rn2(3))
     (void) mkobj_at(FOOD_CLASS, sx, sy, FALSE);
  break;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Slashem-devel mailing list
Slashem-devel@...
https://lists.sourceforge.net/lists/listinfo/slashem-devel

 « Return to Thread: Patch: Eggs in cockatrice nests