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.

26 lines
916 B
Go

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package tuning
import "testing"
// Defaults must keep equipment drop and gold scaling positive so marginal per-slot
// equipment chances (EquipmentDropBase × slot weight) stay non-zero.
func TestDefaultLootTuning_nonZeroEquipmentAndGoldScale(t *testing.T) {
d := DefaultValues()
if d.EquipmentDropBase <= 0 {
t.Fatal("default EquipmentDropBase must be > 0 so equipment can drop")
}
if d.EquipmentDropBase > 1 {
t.Fatal("default EquipmentDropBase should be a probability in (0,1]")
}
if d.GoldLootScale <= 0 {
t.Fatal("default GoldLootScale must be > 0")
}
if d.GoldDropChance <= 0 || d.GoldDropChance > 1 {
t.Fatalf("default GoldDropChance must be in (0,1], got %v", d.GoldDropChance)
}
// Potion is independent; allow 0 only if explicitly intended (currently 0.05).
if d.PotionDropChance < 0 || d.PotionDropChance > 1 {
t.Fatalf("PotionDropChance out of range: %v", d.PotionDropChance)
}
}