CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.72k stars 4.21k forks source link

Dodging continues to increase dodge skill long after message log says it won't #47539

Open wapcaplet opened 3 years ago

wapcaplet commented 3 years ago

Describe the bug

Dodging a regular zombie can train dodging skill up to level 9, even though the zombie only has melee level 4. After reaching level 5, the message log often says "This task is too simple to train your dodging beyond 5", but dodging skill continues to increase all the way up to level 9.

Steps To Reproduce

  1. Gain "Debug Invincibility" mutation
  2. Spawn a regular zombie
  3. Wait in place and see dodging skill increase
  4. Use debug menu to set dodging skill to 8
  5. Wait in place - dodging skill continues to increase until level 9 is reached

Expected behavior

Truthful messaging. If the message log says "This task is too simple to train your dodging beyond 5", then that should in fact be true.

Screenshots

Reaching dodging level 9, after repeated messages saying the task is too simple to train dodging above level 8:

image

Versions and configuration

This is also reproducible in stable 0.E-3.

Additional context

Zombies only have melee level 4, so I am surprised I can even get to level 5 this way, much less level 9.

A quick trace through the code shows that on_dodge is occasionally being invoked with difficulty=8 for a regular zombie.

wapcaplet commented 3 years ago

It appears that when the zombie misses its attack, on_dodge is invoked with a difficulty of 4, while if the zombie successfully lunges or gropes at me, on_dodge is invoked with difficulty of 8. In other words, dodging a successful attack is harder than dodging an attack that would have missed anyway(?)

I don't know if the intended cap is 4, 5, 8, or 9, but the messaging should at least be consistent with what happens to skill level.