Skip to content

Two edges left by the search refund and the scroll pre-check #129

Closed

Description

@mmacy

Found by the review of #124.

The far side of a discovered secret door is not refunded

A room_traps search from either cell of a secret-door edge covers that edge, and an undiscovered secret door hides the trap beyond it from both sides. Discovering the door refunds the room_traps attempts of the cell the discovery names (the searcher's cell, or the cell SetDoorState addresses) and no other. A member who searched the far cell while the door was wall keeps exploration.search.already_tried after walking round to it, for a trap now visible from there too. Refunding both cells of the edge is the rule the discovery implies.

A battle round can change what a scroll declaration was judged on

_validate_magic_item_declaration in crawl/battle.py runs validate_scroll_cast in the declaration phase, and _resolve_scroll_cast spends the scroll and takes the thief draw in the magic phase without re-validating. Between the two, a monster dying can shrink an area footprint, a group closing can change the range, and a caster stunned, restrained, or covered by an anti-magic shell can become unable to cast, and cast_from_scroll then raises ValueError mid-round. The same gap exists for memorized spells and is older than #124; the fix is a re-validation in the magic phase that turns such a read into a fizzle with an event rather than a raise.

https://claude.ai/code/session_01NmCezTw8hKKujkaEZ3YGAs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions