further ongoing changes

Swap out single object for four separate ones to support tiles
rename to 'glob' to avoid confusion with acid/quivering blobs
This commit is contained in:
Derek S. Ray
2015-03-15 21:46:26 -04:00
parent b8dc3a6e43
commit 68b8931918
7 changed files with 346 additions and 267 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 obj.h $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 obj.h $NHDT-Date: 1426470329 2015/03/16 01:45:29 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.35 $ */
/* NetHack 3.5 obj.h $Date: 2012/01/10 17:47:16 $ $Revision: 1.31 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -94,7 +94,7 @@ struct obj {
Bitfield(recharged,3); /* number of times it's been recharged */
#define on_ice recharged /* corpse on ice */
Bitfield(lamplit,1); /* a light-source -- can be lit */
Bitfield(oreserved1,1); /* was the placeholder for invisible objects, free for use */
Bitfield(oglobby,1); /* globby; will combine with like types on adjacent squares */
Bitfield(greased,1); /* covered with grease */
Bitfield(nomerge,1); /* set temporarily to prevent merging */
Bitfield(was_thrown,1); /* thrown by hero since last picked up */
@@ -230,6 +230,11 @@ struct obj {
#define polyfodder(obj) (ofood(obj) && pm_to_cham((obj)->corpsenm) != NON_PM)
#define mlevelgain(obj) (ofood(obj) && (obj)->corpsenm == PM_WRAITH)
#define mhealup(obj) (ofood(obj) && (obj)->corpsenm == PM_NURSE)
#define Is_pudding(o) (o->otyp == GLOB_OF_GRAY_OOZE \
|| o->otyp == GLOB_OF_BROWN_PUDDING \
|| o->otyp == GLOB_OF_GREEN_SLIME \
|| o->otyp == GLOB_OF_BLACK_PUDDING)
/* Containers */
#define carried(o) ((o)->where == OBJ_INVENT)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 mkobj.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 mkobj.c $NHDT-Date: 1426470337 2015/03/16 01:45:37 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.77 $ */
/* NetHack 3.5 mkobj.c $Date: 2012/03/10 02:49:08 $ $Revision: 1.70 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -626,56 +626,59 @@ boolean artif;
break;
case FOOD_CLASS:
otmp->oeaten = 0;
switch(otmp->otyp) {
case CORPSE:
/* possibly overridden by mkcorpstat() */
tryct = 50;
do otmp->corpsenm = undead_to_corpse(rndmonnum());
while ((mvitals[otmp->corpsenm].mvflags & G_NOCORPSE) && (--tryct > 0));
if (tryct == 0) {
/* perhaps rndmonnum() only wants to make G_NOCORPSE monsters on
this level; let's create an adventurer's corpse instead, then */
otmp->corpsenm = PM_HUMAN;
}
/* timer set below */
break;
case EGG:
otmp->corpsenm = NON_PM; /* generic egg */
if (!rn2(3)) for (tryct = 200; tryct > 0; --tryct) {
mndx = can_be_hatched(rndmonnum());
if (mndx != NON_PM && !dead_species(mndx, TRUE)) {
otmp->corpsenm = mndx; /* typed egg */
break;
}
}
/* timer set below */
break;
case TIN:
otmp->corpsenm = NON_PM; /* empty (so far) */
if (!rn2(6))
set_tin_variety(otmp, SPINACH_TIN);
else for (tryct = 200; tryct > 0; --tryct) {
mndx = undead_to_corpse(rndmonnum());
if (mons[mndx].cnutrit &&
!(mvitals[mndx].mvflags & G_NOCORPSE)) {
otmp->corpsenm = mndx;
set_tin_variety(otmp, RANDOM_TIN);
break;
}
}
blessorcurse(otmp, 10);
break;
case SLIME_MOLD:
otmp->spe = context.current_fruit;
flags.made_fruit = TRUE;
break;
case KELP_FROND:
otmp->quan = (long) rnd(2);
break;
}
if (otmp->otyp != CORPSE && otmp->otyp != MEAT_RING &&
otmp->otyp != KELP_FROND && !rn2(6))
otmp->quan = 2L;
switch(otmp->otyp) {
case CORPSE:
/* possibly overridden by mkcorpstat() */
tryct = 50;
do otmp->corpsenm = undead_to_corpse(rndmonnum());
while ((mvitals[otmp->corpsenm].mvflags & G_NOCORPSE) && (--tryct > 0));
if (tryct == 0) {
/* perhaps rndmonnum() only wants to make G_NOCORPSE monsters on
this level; let's create an adventurer's corpse instead, then */
otmp->corpsenm = PM_HUMAN;
}
/* timer set below */
break;
case EGG:
otmp->corpsenm = NON_PM; /* generic egg */
if (!rn2(3)) for (tryct = 200; tryct > 0; --tryct) {
mndx = can_be_hatched(rndmonnum());
if (mndx != NON_PM && !dead_species(mndx, TRUE)) {
otmp->corpsenm = mndx; /* typed egg */
break;
}
}
/* timer set below */
break;
case TIN:
otmp->corpsenm = NON_PM; /* empty (so far) */
if (!rn2(6))
set_tin_variety(otmp, SPINACH_TIN);
else for (tryct = 200; tryct > 0; --tryct) {
mndx = undead_to_corpse(rndmonnum());
if (mons[mndx].cnutrit &&
!(mvitals[mndx].mvflags & G_NOCORPSE)) {
otmp->corpsenm = mndx;
set_tin_variety(otmp, RANDOM_TIN);
break;
}
}
blessorcurse(otmp, 10);
break;
case SLIME_MOLD:
otmp->spe = context.current_fruit;
flags.made_fruit = TRUE;
break;
case KELP_FROND:
otmp->quan = (long) rnd(2);
break;
}
if (Is_pudding(otmp)) {
otmp->oglobby = 1;
} else if (otmp->otyp != CORPSE && otmp->otyp != MEAT_RING
&& otmp->otyp != KELP_FROND && !rn2(6)) {
otmp->quan = 2L;
}
break;
case GEM_CLASS:
otmp->corpsenm = 0; /* LOADSTONE hack */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 mon.c $NHDT-Date: 1426458561 2015/03/15 22:29:21 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.139 $ */
/* NetHack 3.5 mon.c $NHDT-Date: 1426470347 2015/03/16 01:45:47 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.140 $ */
/* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -268,29 +268,31 @@ unsigned corpseflags;
obj = mksobj_at(SCR_BLANK_PAPER, x, y, TRUE, FALSE);
free_mname(mtmp);
break;
case PM_BLACK_PUDDING:
case PM_GREEN_SLIME:
case PM_BROWN_PUDDING:
/* expired puddings will congeal into a large blob
like dragons, relies on the order remaining consistent */
case PM_GRAY_OOZE:
/* expired puddings will congeal into a large blob */
obj = mksobj_at(BLOB_OF_PUDDING, x, y, TRUE, FALSE);
case PM_BROWN_PUDDING:
case PM_GREEN_SLIME:
case PM_BLACK_PUDDING:
obj = mksobj_at(GLOB_OF_BLACK_PUDDING - (PM_BLACK_PUDDING - mndx),
x, y, TRUE, FALSE);
free_mname(mtmp);
break;
break;
default_1:
default:
if (mvitals[mndx].mvflags & G_NOCORPSE)
return (struct obj *)0;
else {
corpstatflags |= CORPSTAT_INIT;
/* preserve the unique traits of some creatures */
obj = mkcorpstat(CORPSE, KEEPTRAITS(mtmp) ? mtmp : 0,
mdat, x, y, corpstatflags);
if (burythem) {
(void) bury_an_obj(obj);
newsym(x, y);
return obj;
}
}
if (mvitals[mndx].mvflags & G_NOCORPSE)
return (struct obj *)0;
else {
corpstatflags |= CORPSTAT_INIT;
/* preserve the unique traits of some creatures */
obj = mkcorpstat(CORPSE, KEEPTRAITS(mtmp) ? mtmp : 0,
mdat, x, y, corpstatflags);
if (burythem) {
(void) bury_an_obj(obj);
newsym(x, y);
return obj;
}
}
break;
}
/* All special cases should precede the G_NOCORPSE check */

View File

@@ -1,5 +1,4 @@
/* NetHack 3.5 objects.c $NHDT-Date: 1426458573 2015/03/15 22:29:33 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.26 $ */
/* NetHack 3.5 objects.c $Date: 2011/07/28 04:00:20 $ $Revision: 1.23 $ */
/* NetHack 3.5 objects.c $NHDT-Date: 1426470348 2015/03/16 01:45:48 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.27 $ */
/* Copyright (c) Mike Threepoint, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -671,8 +670,11 @@ FOOD("meatball", 0, 1, 1, 0, FLESH, 5, CLR_BROWN),
FOOD("meat stick", 0, 1, 1, 0, FLESH, 5, CLR_BROWN),
FOOD("huge chunk of meat", 0,20,400, 0, FLESH,2000, CLR_BROWN),
/* pudding 'corpses' will turn into this */
FOOD("blob of pudding", 0, 1, 1, 0, FLESH, 0, CLR_BROWN),
/* pudding 'corpses' will turn into these and combine */
FOOD("glob of gray ooze", 0, 1, 1, 0, FLESH, 0, CLR_GRAY),
FOOD("glob of brown pudding", 0, 1, 1, 0, FLESH, 0, CLR_BROWN),
FOOD("glob of green slime", 0, 1, 1, 0, FLESH, 0, CLR_GREEN),
FOOD("glob of black pudding", 0, 1, 1, 0, FLESH, 0, CLR_BLACK),
/* special case because it's not mergable */
OBJECT(OBJ("meat ring", (char *)0),

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 objnam.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 objnam.c $NHDT-Date: 1426470349 2015/03/16 01:45:49 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.108 $ */
/* NetHack 3.5 objnam.c $Date: 2011/10/27 02:24:54 $ $Revision: 1.101 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -373,6 +373,14 @@ register struct obj *obj;
}
break;
}
if (Is_pudding(obj)) {
Sprintf(buf, "%s%s",
obj->owt < 100 ? "small "
: obj->owt > 500 ? "very large "
: obj->owt > 300 ? "large "
: "", actualn);
break;
}
Strcpy(buf, actualn);
if (typ == TIN && known)

File diff suppressed because it is too large Load Diff

View File

@@ -45,6 +45,8 @@ while (my $line = <INFILE>)
close(INFILE);
close(OUTFILE);
unless ($debug) { unlink $infile; }
exit;
sub main::HELP_MESSAGE()