Closed phylll closed 2 years ago
Quick review of defense
code says this should be doable by injecting a bunch of conditional blocks that executes the actual defense logic only if the noDefense
flag (whatever it will be called) is not present.
Research question: How about health <= 3, aren't those tokens equally defenseless? Are we handling this case properly so far? -- No, we have not. According to Kodex:64, less than 4 health points means that someone is incapacitated and doesn't get a defense at all.
So, when does the target of an attack not get a defense roll?
In those cases, the player should not even need to enter various pointless modifiers for a roll that is not being made. Since we cannot build logical forks between scripts (because Roll20 doesn't evaluate user input in scripts dynamically called through !mmm chat: %{char|ability}
), the way to do this is to pull the defensibility determination back into all kinds of attack scripts. To cover all use cases, that means:
meleeAttack
already has the player select a modifier if they attack an otherwise defenseless target;rangedAttack
doesn't but could add such a modifier easily;So, these four attack scripts (no. 2 through 5, above) would check for health/endurance and the player's manual determinations and as a result either call the main defense script directly (if no further input is necessary because there won't be a real defense), or a customize wrapper to collect defense modifiers and then call the main defense script to do its thing.
Or, we simply offer players a "defenseless" option for every call, and that's it.
Surprised targets of attacks do not get to defend, but still suffer -- potentially lethal -- effects that need to be recorded properly. The defense script or a version of it should be able to handle this edge case.