forked from df-mc/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
soul_speed.go
47 lines (38 loc) · 989 Bytes
/
soul_speed.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package enchantment
import (
"github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/item"
"github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/world"
)
// SoulSpeed is an enchantment that can be applied on boots and allows the player to walk more quickly on soul sand or
// soul soil.
type SoulSpeed struct{}
// Name ...
func (SoulSpeed) Name() string {
return "Soul Speed"
}
// MaxLevel ...
func (SoulSpeed) MaxLevel() int {
return 3
}
// Cost ...
func (SoulSpeed) Cost(level int) (int, int) {
min := level * 10
return min, min + 15
}
// Rarity ...
func (SoulSpeed) Rarity() item.EnchantmentRarity {
return item.EnchantmentRarityVeryRare
}
// Treasure ...
func (SoulSpeed) Treasure() bool {
return true
}
// CompatibleWithEnchantment ...
func (SoulSpeed) CompatibleWithEnchantment(item.EnchantmentType) bool {
return true
}
// CompatibleWithItem ...
func (SoulSpeed) CompatibleWithItem(i world.Item) bool {
b, ok := i.(item.BootsType)
return ok && b.Boots()
}