Juiblex can split like a pudding. The clones cannot split.
If you kill the original Juiblex, one of the clones becomes it.
result = ((int) gm.mvitals[mndx].born < lim && !gone) ? TRUE : FALSE;
/* if it's unique, don't ever make it again */
- if ((mons[mndx].geno & G_UNIQ) != 0 && mndx != PM_HIGH_CLERIC)
+ if ((mons[mndx].geno & G_UNIQ) != 0
+ && mndx != PM_HIGH_CLERIC
+ && mndx != PM_JUIBLEX)
gm.mvitals[mndx].mvflags |= G_EXTINCT;
if (gm.mvitals[mndx].born < 255 && tally && (!ghostly || result))
if (strike) {
res[i] = hitmm(magr, mdef, mattk, mwep, dieroll);
if ((mdef->data == &mons[PM_BLACK_PUDDING]
- || mdef->data == &mons[PM_BROWN_PUDDING])
+ || mdef->data == &mons[PM_BROWN_PUDDING]
+ || (mdef->data == &mons[PM_JUIBLEX] && !mdef->mcloned))
&& (mwep && (objects[mwep->otyp].oc_material == IRON
|| objects[mwep->otyp].oc_material == METAL))
&& mdef->mhp > 1 && !mdef->mcan) {
static void m_detach(struct monst *, struct permonst *);
static void set_mon_min_mhpmax(struct monst *, int);
static void lifesaved_monster(struct monst *);
+static void juiblex_transferral(void);
static boolean ok_to_obliterate(struct monst *);
static void m_restartcham(struct monst *);
static boolean restrap(struct monst *);
DISABLE_WARNING_FORMAT_NONLITERAL
+/* transfer the juiblex "mind" to a clone */
+static void
+juiblex_transferral(void)
+{
+ struct monst *mtmp;
+
+ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon)
+ if (!DEADMONSTER(mtmp)
+ && mtmp->data == &mons[PM_JUIBLEX] && mtmp->mcloned) {
+ mtmp->mcloned = 0;
+ return;
+ }
+}
+
void
mondead(struct monst *mtmp)
{
else if (mtmp->data == &mons[PM_WERERAT])
set_mon_data(mtmp, &mons[PM_HUMAN_WERERAT]);
+ if (mtmp->data == &mons[PM_JUIBLEX] && !mtmp->mcloned)
+ juiblex_transferral();
+
/*
* gm.mvitals[].died does double duty as total number of dead monsters
* and as experience factor for the player killing more monsters.
static void
hmon_hitmon_splitmon(struct _hitmon_data *hmd, struct monst *mon, struct obj *obj)
{
- if ((hmd->mdat == &mons[PM_BLACK_PUDDING] || hmd->mdat == &mons[PM_BROWN_PUDDING])
+ if ((hmd->mdat == &mons[PM_BLACK_PUDDING]
+ || hmd->mdat == &mons[PM_BROWN_PUDDING]
+ || (hmd->mdat == &mons[PM_JUIBLEX] && !mon->mcloned))
/* pudding is alive and healthy enough to split */
&& mon->mhp > 1 && !mon->mcan
/* iron weapon using melee or polearm hit [3.6.1: metal weapon too;
char withwhat[BUFSZ];
if ((mclone = clone_mon(mon, 0, 0)) != 0) {
- withwhat[0] = '\0';
- if (u.twoweap && Verbose(4, hmon_hitmon1))
- Sprintf(withwhat, " with %s", yname(obj));
- pline("%s divides as you hit it%s!", Monnam(mon), withwhat);
- hmd->hittxt = TRUE;
- (void) mintrap(mclone, NO_TRAP_FLAGS);
+ if (canspotmon(mclone) && !u.uswallow) {
+ withwhat[0] = '\0';
+ if (u.twoweap && Verbose(4, hmon_hitmon1))
+ Sprintf(withwhat, " with %s", yname(obj));
+ pline("%s divides as you hit it%s!", Monnam(mon),
+ withwhat);
+ hmd->hittxt = TRUE;
+ (void) mintrap(mclone, NO_TRAP_FLAGS);
+ }
}
}
}
if (gv.vis && canseemon(mdef))
ncflags |= NC_SHOW_MSG;
- if (newcham(mdef, &mons[PM_GREEN_SLIME], ncflags))
+ if (newcham(mdef, &mons[PM_GREEN_SLIME], ncflags))
pd = mdef->data;
mdef->mstrategy &= ~STRAT_WAITFORU;
mhm->hitflags = MM_HIT;
{
unsigned long strat, dstrat;
+ /* Only one Juiblex has a mind */
+ if (mtmp->data == &mons[PM_JUIBLEX] && mtmp->mcloned)
+ return STRAT_NONE;
+
if (!is_covetous(mtmp->data)
/* perhaps a shopkeeper has been polymorphed into a master
lich; we don't want it teleporting to the stairs to heal