Ticket #645 (new bug)

Opened 3 months ago

Last modified 3 months ago

Incorrect handling of amnesia when computing spell fail rate

Reported by: anonymous Assigned to:
Milestone: 3.2.0 Version:
Keywords: Cc:

Description

Amnesia is supposed to make reading scrolls, activating objects and casting spells fail half of the time. For scrolls and objects, amnesia is handled correctly:

if ((rand_int(2) != 0) && p_ptr->timed[TMD_AMNESIA]) then fail

For spells, the following is used:

if (p_ptr->timed[TMD_AMNESIA]) chance *= 2;

Of course, this means that amnesia has absolutely no effect on spells with 0% fail rate, and that spells with a fail rate above 50% will always fail. The following would be more logical:

if ((rand_int(2) != 0) && p_ptr->timed[TMD_AMNESIA]) chance = 100;

Attachments

Change History

(follow-up: ↓ 2 ) 10/15/08 15:09:16 changed by ChodTheWacko

I assume in the latter you meant: if ((rand_int(2) != 0) && p_ptr->timed[TMD_AMNESIA]) chance = 0;

(in reply to: ↑ 1 ) 10/16/08 06:50:17 changed by anonymous

Replying to ChodTheWacko:

I assume in the latter you meant: if ((rand_int(2) != 0) && p_ptr->timed[TMD_AMNESIA]) chance = 0;

No, it's 100 because the function returns the chance of failing the spell, not the chance of succeeding. And the line should be the last line of the function, since amnesia should bypass all other checks.


Add/Change #645 (Incorrect handling of amnesia when computing spell fail rate)