Closed mysterymagination closed 3 years ago
I may have to write a shudder unit test!
I wrote a couple tests for this and they helped shake out that the problem was a simple matter of me forgetting to actually init the consumeTimeout field; this caused it to be undefined when I compared it against 0 later and it seems good ol' JS doesn't complain when you compare undefined to a number -- the comparison simply resolves to false no matter what X|
That is NOT helpful, JS!
Once I added the else {chill_beyond} branch that resulted in a selection of consume always going to chill_beyond, and before I added that branch it meant that the limiter on consume usage immediately returned false re: overuse and therefore the chosen abl remained consume, allowing him to spam it when the prob gets high close to death.
I had him down to about 10% health and he used consume four damn times in a row! That move is supposed to be limited to 2x consecutively, and if he does so there's supposed to be a 1d4 turn timeout for consume.