diff --git a/src/muse.c b/src/muse.c index 012ac8b8..7368d41d 100644 --- a/src/muse.c +++ b/src/muse.c @@ -244,16 +244,14 @@ struct obj *otmp; #define MUSE_TELEPORT_TRAP 7 #define MUSE_UPSTAIRS 8 #define MUSE_DOWNSTAIRS 9 -#define MUSE_WAN_CREATE_MONSTER 10 -#define MUSE_SCR_CREATE_MONSTER 11 -#define MUSE_UP_LADDER 12 -#define MUSE_DN_LADDER 13 -#define MUSE_SSTAIRS 14 +#define MUSE_UP_LADDER 10 +#define MUSE_DN_LADDER 11 +#define MUSE_SSTAIRS 12 +#define MUSE_BUGLE 13 +#define MUSE_UNICORN_HORN 14 #define MUSE_WAN_TELEPORTATION 15 -#define MUSE_BUGLE 16 -#define MUSE_UNICORN_HORN 17 -#define MUSE_POT_FULL_HEALING 18 -#define MUSE_LIZARD_CORPSE 19 +#define MUSE_POT_FULL_HEALING 16 +#define MUSE_LIZARD_CORPSE 17 /* #define MUSE_INNATE_TPT 9999 * We cannot use this. Since monsters get unlimited teleportation, if they @@ -556,11 +554,6 @@ struct monst *mtmp; m.defensive = obj; m.has_defense = MUSE_POT_EXTRA_HEALING; } - nomore(MUSE_WAN_CREATE_MONSTER); - if (obj->otyp == WAN_CREATE_MONSTER && obj->spe > 0) { - m.defensive = obj; - m.has_defense = MUSE_WAN_CREATE_MONSTER; - } nomore(MUSE_POT_HEALING); if (obj->otyp == POT_HEALING) { m.defensive = obj; @@ -572,16 +565,6 @@ struct monst *mtmp; m.defensive = obj; m.has_defense = MUSE_POT_FULL_HEALING; } - nomore(MUSE_WAN_CREATE_MONSTER); - if (obj->otyp == WAN_CREATE_MONSTER && obj->spe > 0) { - m.defensive = obj; - m.has_defense = MUSE_WAN_CREATE_MONSTER; - } - } - nomore(MUSE_SCR_CREATE_MONSTER); - if (obj->otyp == SCR_CREATE_MONSTER) { - m.defensive = obj; - m.has_defense = MUSE_SCR_CREATE_MONSTER; } } botm: @@ -752,62 +735,6 @@ struct monst *mtmp; (coord *) 0); return 2; } - case MUSE_WAN_CREATE_MONSTER: { - coord cc; - /* pm: 0 => random, eel => aquatic, croc => amphibious */ - struct permonst *pm = - !is_pool(mtmp->mx, mtmp->my) - ? 0 - : &mons[u.uinwater ? PM_GIANT_EEL : PM_CROCODILE]; - struct monst *mon; - - if (!enexto(&cc, mtmp->mx, mtmp->my, pm)) - return 0; - mzapmsg(mtmp, otmp, FALSE); - otmp->spe--; - mon = makemon((struct permonst *) 0, cc.x, cc.y, NO_MM_FLAGS); - if (mon && canspotmon(mon) && oseen) - makeknown(WAN_CREATE_MONSTER); - return 2; - } - case MUSE_SCR_CREATE_MONSTER: { - coord cc; - struct permonst *pm = 0, *fish = 0; - int cnt = 1; - struct monst *mon; - boolean known = FALSE; - - if (!rn2(73)) - cnt += rnd(4); - if (mtmp->mconf || otmp->cursed) - cnt += 12; - if (mtmp->mconf) - pm = fish = &mons[PM_ACID_BLOB]; - else if (is_pool(mtmp->mx, mtmp->my)) - fish = &mons[u.uinwater ? PM_GIANT_EEL : PM_CROCODILE]; - mreadmsg(mtmp, otmp); - while (cnt--) { - /* `fish' potentially gives bias towards water locations; - `pm' is what to actually create (0 => random) */ - if (!enexto(&cc, mtmp->mx, mtmp->my, fish)) - break; - mon = makemon(pm, cc.x, cc.y, NO_MM_FLAGS); - if (mon && canspotmon(mon)) - known = TRUE; - } - /* The only case where we don't use oseen. For wands, you - * have to be able to see the monster zap the wand to know - * what type it is. For teleport scrolls, you have to see - * the monster to know it teleported. - */ - if (known) - makeknown(SCR_CREATE_MONSTER); - else if (!objects[SCR_CREATE_MONSTER].oc_name_known - && !objects[SCR_CREATE_MONSTER].oc_uname) - docall(otmp); - m_useup(mtmp, otmp); - return 2; - } case MUSE_TRAPDOOR: /* trap doors on "bottom" levels of dungeons are rock-drop * trap doors, not holes in the floor. We check here for @@ -1591,6 +1518,9 @@ struct monst *mtmp; #define MUSE_WAN_SPEED_MONSTER 7 #define MUSE_BULLWHIP 8 #define MUSE_POT_POLYMORPH 9 +#define MUSE_WAN_CREATE_MONSTER 10 +#define MUSE_SCR_CREATE_MONSTER 11 + boolean find_misc(mtmp) @@ -1675,6 +1605,17 @@ struct monst *mtmp; m.misc = obj; m.has_misc = MUSE_BULLWHIP; } + nomore(MUSE_WAN_CREATE_MONSTER); + if (obj->otyp == WAN_CREATE_MONSTER && obj->spe > 0 + && !mtmp->mpeaceful) { + m.misc = obj; + m.has_misc = MUSE_WAN_CREATE_MONSTER; + } + nomore(MUSE_SCR_CREATE_MONSTER); + if (obj->otyp == SCR_CREATE_MONSTER && !mtmp->mpeaceful) { + m.misc = obj; + m.has_misc = MUSE_SCR_CREATE_MONSTER; + } /* Note: peaceful/tame monsters won't make themselves * invisible unless you can see them. Not really right, but... */ @@ -1852,6 +1793,62 @@ struct monst *mtmp; makeknown(POT_POLYMORPH); m_useup(mtmp, otmp); return 2; + case MUSE_WAN_CREATE_MONSTER: { + coord cc; + /* pm: 0 => random, eel => aquatic, croc => amphibious */ + struct permonst *pm = + !is_pool(mtmp->mx, mtmp->my) + ? 0 + : &mons[u.uinwater ? PM_GIANT_EEL : PM_CROCODILE]; + struct monst *mon; + + if (!enexto(&cc, mtmp->mx, mtmp->my, pm)) + return 0; + mzapmsg(mtmp, otmp, FALSE); + otmp->spe--; + mon = makemon((struct permonst *) 0, cc.x, cc.y, NO_MM_FLAGS); + if (mon && canspotmon(mon) && oseen) + makeknown(WAN_CREATE_MONSTER); + return 2; + } + case MUSE_SCR_CREATE_MONSTER: { + coord cc; + struct permonst *pm = 0, *fish = 0; + int cnt = 1; + struct monst *mon; + boolean known = FALSE; + + if (!rn2(73)) + cnt += rnd(4); + if (mtmp->mconf || otmp->cursed) + cnt += 12; + if (mtmp->mconf) + pm = fish = &mons[PM_ACID_BLOB]; + else if (is_pool(mtmp->mx, mtmp->my)) + fish = &mons[u.uinwater ? PM_GIANT_EEL : PM_CROCODILE]; + mreadmsg(mtmp, otmp); + while (cnt--) { + /* `fish' potentially gives bias towards water locations; + `pm' is what to actually create (0 => random) */ + if (!enexto(&cc, mtmp->mx, mtmp->my, fish)) + break; + mon = makemon(pm, cc.x, cc.y, NO_MM_FLAGS); + if (mon && canspotmon(mon)) + known = TRUE; + } + /* The only case where we don't use oseen. For wands, you + * have to be able to see the monster zap the wand to know + * what type it is. For teleport scrolls, you have to see + * the monster to know it teleported. + */ + if (known) + makeknown(SCR_CREATE_MONSTER); + else if (!objects[SCR_CREATE_MONSTER].oc_name_known + && !objects[SCR_CREATE_MONSTER].oc_uname) + docall(otmp); + m_useup(mtmp, otmp); + return 2; + } case MUSE_POLY_TRAP: if (vismon) pline("%s deliberately %s onto a polymorph trap!", Monnam(mtmp),