combine taming of already tame monsters

Merge the recent change in the effect of blessed scroll of taming on
already tame monsters with the earlier change of any taming on already
tame monsters.  Non-blessed has a chance of boosting monst->mtame by 1
when it is less than 10, more likely the lower the current value is.
For blessed, boost by 2 after that, so possibly by 3 if it is very low.

Make spell of charm monster when skilled or expert in enchantment
spells behave the same as blessed scroll of taming.  [I'm not too sure
about this; it may make the spell too powerful.]
This commit is contained in:
PatR
2024-12-07 19:38:01 -08:00
parent a3f0b54aea
commit 13b8725ac2
4 changed files with 32 additions and 19 deletions
-1
View File
@@ -1484,7 +1484,6 @@ when hero who is poly'd into metallivore form eats a tin, bypass "smells like
digging in ice was handled inconsistently, particularly if done at the span digging in ice was handled inconsistently, particularly if done at the span
spot in front of closed drawbridge spot in front of closed drawbridge
angry god may remove an intrinsic angry god may remove an intrinsic
blessed scroll of taming increases tameness of already tame creatures
blessed scroll of destroy armor asks which armor to destroy blessed scroll of destroy armor asks which armor to destroy
+21 -5
View File
@@ -1092,8 +1092,18 @@ dogfood(struct monst *mon, struct obj *obj)
* on the original mtmp. It now returns TRUE if the taming succeeded. * on the original mtmp. It now returns TRUE if the taming succeeded.
*/ */
boolean boolean
tamedog(struct monst *mtmp, struct obj *obj, boolean givemsg) tamedog(
struct monst *mtmp,
struct obj *obj, /* food or scroll/spell */
boolean givemsg)
{ {
boolean blessed_scroll = FALSE;
if (obj && (obj->oclass == SCROLL_CLASS || obj->oclass == SPBOOK_CLASS)) {
blessed_scroll = obj->blessed ? TRUE : FALSE;
/* the rest of this routine assumes 'obj' represents food */
obj = (struct obj *) NULL;
}
/* reduce timed sleep or paralysis, leaving mtmp->mcanmove as-is /* reduce timed sleep or paralysis, leaving mtmp->mcanmove as-is
(note: if mtmp is donning armor, this will reduce its busy time) */ (note: if mtmp is donning armor, this will reduce its busy time) */
if (mtmp->mfrozen) if (mtmp->mfrozen)
@@ -1159,11 +1169,17 @@ tamedog(struct monst *mtmp, struct obj *obj, boolean givemsg)
return FALSE; return FALSE;
} }
/* if already tame, taming magic might make it become tamer */ /* maximum tameness is 20, only reachable via eating; if already tame but
if (mtmp->mtame) { less than 10, taming magic might make it become tamer; blessed scroll
/* maximum tameness is 20, only reachable via eating */ or skilled spell raises low tameness by 2 or 3, uncursed by 0 or 1 */
if (rnd(10) > mtmp->mtame) if (mtmp->mtame && mtmp->mtame < 10) {
if (mtmp->mtame < rnd(10))
mtmp->mtame++; mtmp->mtame++;
if (blessed_scroll) {
mtmp->mtame += 2;
if (mtmp->mtame > 10)
mtmp->mtame = 10;
}
return FALSE; /* didn't just get tamed */ return FALSE; /* didn't just get tamed */
} }
/* pacify angry shopkeeper but don't tame him/her/it/them */ /* pacify angry shopkeeper but don't tame him/her/it/them */
+10 -12
View File
@@ -490,11 +490,13 @@ doread(void)
pline("This %s has no label.", singular(scroll, xname)); pline("This %s has no label.", singular(scroll, xname));
return ECMD_OK; return ECMD_OK;
} else if (otyp == MAGIC_MARKER) { } else if (otyp == MAGIC_MARKER) {
static const int red_mons[] = {
PM_FIRE_ANT, PM_PYROLISK, PM_HELL_HOUND, PM_IMP,
PM_LARGE_MIMIC, PM_LEOCROTTA, PM_SCORPION, PM_XAN,
PM_GIANT_BAT, PM_WATER_MOCCASIN, PM_FLESH_GOLEM,
PM_BARBED_DEVIL, PM_MARILITH, PM_PIRANHA
};
char buf[BUFSZ]; char buf[BUFSZ];
const int red_mons[] = { PM_FIRE_ANT, PM_PYROLISK, PM_HELL_HOUND,
PM_IMP, PM_LARGE_MIMIC, PM_LEOCROTTA, PM_SCORPION, PM_XAN,
PM_GIANT_BAT, PM_WATER_MOCCASIN, PM_FLESH_GOLEM, PM_BARBED_DEVIL,
PM_MARILITH, PM_PIRANHA };
struct permonst *pm = &mons[red_mons[scroll->o_id % SIZE(red_mons)]]; struct permonst *pm = &mons[red_mons[scroll->o_id % SIZE(red_mons)]];
if (Blind) { if (Blind) {
@@ -1037,14 +1039,9 @@ maybe_tame(struct monst *mtmp, struct obj *sobj)
/* for a shopkeeper, tamedog() will call make_happy_shk() but /* for a shopkeeper, tamedog() will call make_happy_shk() but
not tame the target, so call it even if taming gets resisted */ not tame the target, so call it even if taming gets resisted */
if (!resist(mtmp, sobj->oclass, 0, NOTELL) || mtmp->isshk) if (!resist(mtmp, sobj->oclass, 0, NOTELL) || mtmp->isshk)
(void) tamedog(mtmp, (struct obj *) 0, FALSE); (void) tamedog(mtmp, sobj, FALSE);
if (sobj->blessed && was_tame && mtmp->mtame) {
int new_tame = min(10, ACURR(A_CHA) / 2);
if (mtmp->mtame < new_tame) if ((!was_peaceful && mtmp->mpeaceful) || was_tame != mtmp->mtame)
mtmp->mtame = new_tame;
}
if ((!was_peaceful && mtmp->mpeaceful) || (!was_tame && mtmp->mtame))
return 1; return 1;
} }
return 0; return 0;
@@ -2103,7 +2100,8 @@ seffect_mail(struct obj **sobjp)
/* scroll effects; return 1 if we use up the scroll and possibly make it /* scroll effects; return 1 if we use up the scroll and possibly make it
become discovered, 0 if caller should take care of those side-effects */ become discovered, 0 if caller should take care of those side-effects */
int int
seffects(struct obj *sobj) /* sobj - scroll or fake spellbook for spell */ seffects(
struct obj *sobj) /* sobj - scroll or fake spellbook for spell */
{ {
int otyp = sobj->otyp; int otyp = sobj->otyp;
+1 -1
View File
@@ -1509,12 +1509,12 @@ spelleffects(int spell_otyp, boolean atme, boolean force)
case SPE_DETECT_FOOD: case SPE_DETECT_FOOD:
case SPE_CAUSE_FEAR: case SPE_CAUSE_FEAR:
case SPE_IDENTIFY: case SPE_IDENTIFY:
case SPE_CHARM_MONSTER:
/* high skill yields effect equivalent to blessed scroll */ /* high skill yields effect equivalent to blessed scroll */
if (role_skill >= P_SKILLED) if (role_skill >= P_SKILLED)
pseudo->blessed = 1; pseudo->blessed = 1;
FALLTHROUGH; FALLTHROUGH;
/*FALLTHRU*/ /*FALLTHRU*/
case SPE_CHARM_MONSTER:
case SPE_MAGIC_MAPPING: case SPE_MAGIC_MAPPING:
case SPE_CREATE_MONSTER: case SPE_CREATE_MONSTER:
(void) seffects(pseudo); (void) seffects(pseudo);