Allow applying royal jelly on an egg
Royal jelly applied on an egg will change a killer bee egg to a queen bee egg. Cursed jelly will kill the egg, uncursed and blessed will revive it. Blessed jelly will also make the creature think you're the parent. Original patch was by Kenneth Call
This commit is contained in:
@@ -130,6 +130,7 @@ when 'color' if Off and 'use_inverse' is On, draw ice on the map in inverse
|
||||
video if it uses the same character as room floor or as dark floor
|
||||
new 'mention_decor' option; when On, describe dungeon features being stepped
|
||||
on or floated/flown over even when they're not covered by objects
|
||||
applying royal jelly on an egg kills, revives, or changes the egg
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific New Features
|
||||
|
||||
50
src/apply.c
50
src/apply.c
@@ -29,6 +29,7 @@ static int FDECL(use_whip, (struct obj *));
|
||||
static void FDECL(display_polearm_positions, (int));
|
||||
static int FDECL(use_pole, (struct obj *));
|
||||
static int FDECL(use_cream_pie, (struct obj *));
|
||||
static int FDECL(use_royal_jelly, (struct obj *));
|
||||
static int FDECL(use_grapple, (struct obj *));
|
||||
static int FDECL(do_break_wand, (struct obj *));
|
||||
static int FDECL(flip_through_book, (struct obj *));
|
||||
@@ -3130,6 +3131,49 @@ struct obj *obj;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
use_royal_jelly(obj)
|
||||
struct obj *obj;
|
||||
{
|
||||
static const char allowall[2] = { ALL_CLASSES, 0 };
|
||||
struct obj *eobj = getobj(allowall, "rub the royal jelly on");
|
||||
|
||||
if (!eobj)
|
||||
return 0;
|
||||
|
||||
if (obj->quan > 1L)
|
||||
obj = splitobj(obj, 1L);
|
||||
|
||||
You("smear royal jelly all over %s.", yname(eobj));
|
||||
|
||||
if (eobj->otyp != EGG) {
|
||||
useup(obj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (eobj->corpsenm == PM_KILLER_BEE)
|
||||
eobj->corpsenm = PM_QUEEN_BEE;
|
||||
|
||||
if (obj->cursed) {
|
||||
useup(obj);
|
||||
kill_egg(eobj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (eobj->corpsenm != NON_PM) {
|
||||
if (!eobj->timed)
|
||||
attach_egg_hatch_timeout(eobj, 0L);
|
||||
|
||||
/* blessed royal jelly will make the hatched creature think
|
||||
you're the parent - but has no effect if you laid the egg */
|
||||
if (obj->blessed && !eobj->spe)
|
||||
eobj->spe = 2;
|
||||
}
|
||||
|
||||
useup(obj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
use_grapple(obj)
|
||||
struct obj *obj;
|
||||
@@ -3544,7 +3588,8 @@ char class_list[];
|
||||
&& (!otmp->dknown
|
||||
|| (!knowtouchstone && !objects[otyp].oc_name_known))))
|
||||
addstones = TRUE;
|
||||
if (otyp == CREAM_PIE || otyp == EUCALYPTUS_LEAF)
|
||||
if (otyp == CREAM_PIE || otyp == EUCALYPTUS_LEAF
|
||||
|| otyp == LUMP_OF_ROYAL_JELLY)
|
||||
addfood = TRUE;
|
||||
if (otmp->oclass == SPBOOK_CLASS)
|
||||
addspellbooks = TRUE;
|
||||
@@ -3609,6 +3654,9 @@ doapply()
|
||||
case CREAM_PIE:
|
||||
res = use_cream_pie(obj);
|
||||
break;
|
||||
case LUMP_OF_ROYAL_JELLY:
|
||||
res = use_royal_jelly(obj);
|
||||
break;
|
||||
case BULLWHIP:
|
||||
res = use_whip(obj);
|
||||
break;
|
||||
|
||||
@@ -1543,7 +1543,8 @@ register const char *let, *word;
|
||||
&& (otyp != POT_OIL || !otmp->dknown
|
||||
|| !objects[POT_OIL].oc_name_known))
|
||||
|| (otmp->oclass == FOOD_CLASS
|
||||
&& otyp != CREAM_PIE && otyp != EUCALYPTUS_LEAF)
|
||||
&& otyp != CREAM_PIE && otyp != EUCALYPTUS_LEAF
|
||||
&& otyp != LUMP_OF_ROYAL_JELLY)
|
||||
|| (otmp->oclass == GEM_CLASS && !is_graystone(otmp))))
|
||||
|| (!strcmp(word, "invoke")
|
||||
&& !otmp->oartifact
|
||||
|
||||
@@ -1157,7 +1157,7 @@ unsigned doname_flags;
|
||||
&& (known || (g.mvitals[omndx].mvflags & MV_KNOWS_EGG))) {
|
||||
Strcat(prefix, mons[omndx].mname);
|
||||
Strcat(prefix, " ");
|
||||
if (obj->spe)
|
||||
if (obj->spe == 1)
|
||||
Strcat(bp, " (laid by you)");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user