Opened 10 years ago

Closed 10 years ago

#884 closed bug (fixed (in master))

Turn used when using wand/staff with no charges.

Reported by: ajps Owned by: MarbleDice
Milestone: 3.1.2 beta Keywords: commands
Cc:

Description

If you use a wand or staff with no charges left, it uses up a turn, whereas zapping a rod or activating an object that hasn't recharged takes no turn.

Should the behaviour be changed so that when the player already knows a wand/staff has no charges left no turn is used, for consistency's sake?

Change History (11)

comment:1 Changed 10 years ago by magnate

Yes IMO.

comment:2 Changed 10 years ago by morth

I seem to recall that there is a small chance to successfully use a staff/wand, even at 0 charges (though the item will be destroyed). That's probably why it uses up a turn.

comment:3 Changed 10 years ago by rhinocesaurus

This slight chance of success doesn't seem to be the case, with the current code at least (see check_devices in cmd-obj.c).

comment:4 Changed 10 years ago by magnate

  • Keywords commands added
  • Milestone changed from Triage to 3.1.2 beta

comment:5 Changed 10 years ago by MarbleDice

  • Owner set to MarbleDice
  • Status changed from new to assigned

I see two solutions:

1) Remove known empty wands/staves from the item menu when aiming/using.

2) Allow the player to use empty items, but return a message before the turn is consumed.

The former is consistent with the current behavior of rods, the latter is probably friendlier to macros.

comment:6 Changed 10 years ago by anonymous

2 looks good to me

comment:7 Changed 10 years ago by magnate

Although I can see the macro point, introducing extra prompts is to be avoided IMO. Why not a third option: just let the action happen, but print the fail message and don't use a turn. This is consistent with the behaviour of attacking monsters while afraid.

comment:8 Changed 10 years ago by anonymous

Maybe the subtleties of your wording escape me, but that's what I was trying to propose in option 2: You get a message before wasting your turn, like attacking while afraid, moving into a wall, or reciting ?Identify with no unknown items. If you've got a a1*t macro and you mash it too quickly you get a message "That wand has no charges." instead of being left at the item selection prompt, like currently happens with rods.

comment:9 Changed 10 years ago by magnate

Then it is just an issue of wording. I took "return a message before the turn is consumed" to mean print a message, then consume the turn. But actually you meant that the turn is not used at all, so we are in agreement.

comment:10 Changed 10 years ago by magnate

See also #980.

comment:11 Changed 10 years ago by MarbleDice

  • Resolution set to fixed
  • Status changed from assigned to closed

[bbc2214] (SVN r1764). Allows the selection of wands, staves, rods, and activatable items when they are charging or have no charges, but prints a message and does not use the turn. For wands, the player is still prompted for direction before getting the empty message.

Note: See TracTickets for help on using tickets.