Ticket #645 (closed bug: fixed)

Opened 23 months ago

Last modified 13 months ago

Incorrect handling of amnesia when computing spell fail rate

Reported by: anonymous Owned by:
Milestone: 3.1.1 beta 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   Changed 23 months ago 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   Changed 23 months ago 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.

  Changed 20 months ago by takkaria

  • milestone changed from 3.2.0 to 3.1.1 beta

  Changed 20 months ago by stefanor@…

Wouldn't it be even more logical to use if (p_ptr->timed[TMD_AMNESIA]) chance = 50 + chance / 2; so that the displayed failure rate is correct?

  Changed 19 months ago by magnate

If #665 is serious, this problem will go away ...

  Changed 13 months ago by takkaria

  • status changed from new to closed
  • resolution set to fixed

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

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.