mysterymagination / adventures-of-mooty-wort

An Undum eval tale, short and sweet
MIT License
0 stars 0 forks source link

grue spams consume #35

Closed mysterymagination closed 3 years ago

mysterymagination commented 3 years ago

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.

mysterymagination commented 3 years ago

I may have to write a shudder unit test!

mysterymagination commented 3 years ago

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.