You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
531 B
Go

package game
import (
"testing"
"time"
)
func TestAttackIntervalRespectsMinimumCap(t *testing.T) {
got := attackInterval(10.0)
want := minAttackInterval * combatPaceMultiplier
if got != want {
t.Fatalf("expected min interval %s, got %s", want, got)
}
}
func TestAttackIntervalForNormalSpeed(t *testing.T) {
got := attackInterval(2.0)
// 1/2 s per attack at 2 APS, scaled by combatPaceMultiplier
want := 500 * time.Millisecond * combatPaceMultiplier
if got != want {
t.Fatalf("expected %s, got %s", want, got)
}
}