View Single Post
Old 04-30-2019, 05:47 PM   #48
Helborn
 
Join Date: Aug 2005
Default Re: TFT Helper - beta test of app

Quote:
Originally Posted by Fuhrmanator View Post
The bug with carrying over dx penalty still exists. See the proof below.

It's never too late for unit tests! I wrote a bunch for melee before, but probably not in the language you're using? If the app is free, you can consider open sourcing the code?

http://i.imgur.com/PZzCAM2.jpg

Edit: here's some source for a sample unit-test (hope you can get the idea) that asserts that no dx penalty occurs at the start of the round, that it exists after the hero takes 5 hits, and that it persists for at least an entire round:

dexPenaltyLastsOneCompleteRound: function (o) {
assert(o.hero.sufferingDexPenalty()).not();
o.hero.takeHits(5);
assert(o.hero.sufferingDexPenalty());
o.hero.newRound();
assert(o.hero.damageTakenThisRound()).equals(0);
assert(o.hero.sufferingDexPenalty());
o.hero.newRound();
assert(o.hero.sufferingDexPenalty()).not();
},

The "takeHits" needs to be >=5
The "damageTakenThisRound()).equals(0) is incorrect because the DX penalty exists regardless of how much damage is taken or not taken.
Also, the penalty is only supposed to exist from one action phase to the next.

I haven't see how you define "newRound" but I think it needs clarification.


Char A takes action, then suffers 5 hits. Next turn, takes another 5 hits before he can act, DX penalty is only -2 though 10 points of damage was taken over 2 turns. And he is not knocked down and, unless his ST is now 3 or less, does not suffer the additional -3 DX penalty.
__________________
Helborn
Helborn is offline   Reply With Quote