Skip to content

Commit

Permalink
Lessen harshness of enchanting antimagic items.
Browse files Browse the repository at this point in the history
We'll be a bit more lenient, so that there is a reasonable chance of enchanting these items up at least a little bit at first. I tried to match the behavior of ring enchantment, so that there is a low chance of failure at low enchantment, but it scales at you get higher.

For enchant armor:
+0	 0%
+1	14%
+2	29%
+3	43%
+4	57%

For enchant weapon:
Wep	Chance of failure
+0	 0%
+1	 8%
+2	15%
+3	23%
+4	31%
+5	38%
+6	46%
+7	54%
+8	62%
+9	69%
+10	77%
+11	85%
+12	92%
  • Loading branch information
elunna committed Dec 5, 2024
1 parent 428e0f3 commit fad06f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,13 +1385,13 @@ seffect_enchant_armor(struct obj **sobjp)
return;
}

/* Items which provide magic resistance also resist enchanting.
* They don't resist when their enchantment is negative, that is
/* Items which provide magic resistance also can resist enchanting.
* They don't resist when their enchantment is zero or negative, that is
* "un"-enchanting a bad enchantment. But for anything starting at
* +0 has a 1 in (enchantment + 2) chance of failure. */
* +1 has a x in 7 chance of failure. */
resists_magic = objects[otmp->otyp].oc_oprop == ANTIMAGIC
|| defends(AD_MAGM, otmp);;
if (resists_magic && otmp->spe >= 0 && rn2(otmp->spe + 2)) {
if (resists_magic && otmp->spe > rn2(7) + 1) {
pline("%s vibrates and resists!", Yname2(otmp));
return;
}
Expand Down Expand Up @@ -1839,7 +1839,7 @@ seffect_enchant_weapon(struct obj **sobjp)
/* Items that grant magic resistance themselves resist enchantment. */
resists_magic = uwep && (objects[uwep->otyp].oc_oprop == ANTIMAGIC
|| defends(AD_MAGM, uwep));
if (uwep && resists_magic && uwep->spe >= 0 && rn2(uwep->spe + 2)) {
if (uwep && resists_magic && uwep->spe > rn2(13) + 1) {
pline("%s vibrates and resists!", Yname2(uwep));
return;
}
Expand Down

0 comments on commit fad06f6

Please sign in to comment.