2019-11-21 22:14:27 +00:00
|
|
|
testing("Cooldown", test => {
|
|
|
|
test.case("applies overheat and cooldown", check => {
|
|
|
|
let cooldown = new Cooldown();
|
|
|
|
check.equals(cooldown.canUse(), true);
|
2017-04-18 19:51:23 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.use();
|
|
|
|
check.equals(cooldown.canUse(), true);
|
2017-05-16 23:12:05 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.configure(2, 3);
|
|
|
|
check.equals(cooldown.canUse(), true);
|
2017-04-18 19:51:23 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.use();
|
|
|
|
check.equals(cooldown.canUse(), true);
|
2017-04-18 19:51:23 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.use();
|
|
|
|
check.equals(cooldown.canUse(), false);
|
2017-04-18 19:51:23 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.cool();
|
|
|
|
check.equals(cooldown.canUse(), false);
|
2017-04-18 19:51:23 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.cool();
|
|
|
|
check.equals(cooldown.canUse(), false);
|
2017-04-18 19:51:23 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.cool();
|
|
|
|
check.equals(cooldown.canUse(), true);
|
2017-05-16 23:12:05 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.configure(1, 0);
|
|
|
|
check.equals(cooldown.canUse(), true);
|
2017-05-16 23:12:05 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.use();
|
|
|
|
check.equals(cooldown.canUse(), false);
|
2017-05-22 16:29:04 +00:00
|
|
|
|
2019-11-21 22:14:27 +00:00
|
|
|
cooldown.cool();
|
|
|
|
check.equals(cooldown.canUse(), true);
|
|
|
|
});
|
|
|
|
});
|