ivan icon indicating copy to clipboard operation
ivan copied to clipboard

"Do you want to attack this person" should default to No if you move forward again.

Open ghost opened this issue 9 years ago • 8 comments

If you're wandering through for example, Attnam, and you walk into someone then tap in their direction again, you now attack them, which obviously doesn't go too well...

I imagine this popped up when the door opening behavior was changed to automatically attempt to open doors while moving into them, but in any case it this should be made to use the old behavior of nothing happening when pressing towards the NPCs again.

ghost avatar Oct 31 '15 03:10 ghost

When I move towards someone twice, no attacking takes place, the action just gets cancelled. Are you running the latest version?

But while we're there, I think it's annoying that when you walk towards a non-hostile non-tame character, attacking is considered the default behavior. I would love to have displacing be the default behavior there, just like when you walk towards tame characters.

emlai avatar Oct 31 '15 10:10 emlai

Everything is up to date.

I did some more testing and it seems I may have just been an idiot and I was holding Y...

Anyways, if the default was to not attack them then how would you attack them when you did want to? Also as far as I know you can't displace non-tame characters anyways.

ghost avatar Oct 31 '15 15:10 ghost

if the default was to not attack them then how would you attack them when you did want to?

Same as what you do now when you want to attack tame characters. I.e. kick them, throw an item at them, zap with an evil wand, etc. (There could maybe be a dedicated key for normal attacking, too.)

Also as far as I know you can't displace non-tame characters anyways.

Yeah I guess right now you can't. But it seems to be possible to implement without breaking anything. You can replace line 1217 in char.cpp with the following to test out my idea:

      return (Important
              && (CanMoveOn(MoveToSquare[0])
                  || (IsPlayer()
                      && game::GoThroughWallsCheatIsActive()))
              && Displace(Neutral[0]));

emlai avatar Nov 01 '15 12:11 emlai

This doesn't seem to be a problem in 5.0.5. However, when using the hjklyubn keys for movement, it's easy to accidentally attack a neutral NPC in the following two cases:

  • I'm trying to move northwest by pressing y, and a character blocks me. I press y and it's interpreted as an attack.
  • I'm trying to move in another direction (particularly north or west), and a character blocks me. I try to move in an adjacent direction (northwest) by pressing y, and it's interpreted as an attack.

I've done these at least 5 times this month. I killed the game and savescummed after each one, and make no apology for it. :P I think the best solution to this problem would be to require shift-Y to confirm attacks, when the nethack input configuration is active.

serin-delaunay avatar May 02 '16 23:05 serin-delaunay

I think the best solution to this problem would be to require shift-Y to confirm attacks, when the nethack input configuration is active.

I agree that the game should require a capital Y to confirm attacks, IMO that wouldn't be a problem in other key configurations either.

emlai avatar May 03 '16 12:05 emlai

could this https://github.com/Attnam/ivan/pull/367 solve this issue in a different way?

AquariusPower avatar May 28 '18 00:05 AquariusPower

Resolved?

red-kangaroo avatar Jan 16 '19 20:01 red-kangaroo

Aquarius's solution is a nice intermediate, and I always turn it on. However I think we should still switch to capital Y to confirm attacks on NPCs

andrewtweber avatar Jan 16 '19 21:01 andrewtweber