forked from df-mc/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vanishing.go
55 lines (45 loc) · 1.17 KB
/
vanishing.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
48
49
50
51
52
53
54
55
package enchantment
import (
"github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/item"
"github.com/Adrian8115/dragonfly-Amethyst-Protocol/server/world"
)
// CurseOfVanishing is an enchantment that causes the item to disappear on death.
type CurseOfVanishing struct{}
// Name ...
func (CurseOfVanishing) Name() string {
return "Curse of Vanishing"
}
// MaxLevel ...
func (CurseOfVanishing) MaxLevel() int {
return 1
}
// Cost ...
func (CurseOfVanishing) Cost(int) (int, int) {
return 25, 50
}
// Rarity ...
func (CurseOfVanishing) Rarity() item.EnchantmentRarity {
return item.EnchantmentRarityVeryRare
}
// CompatibleWithEnchantment ...
func (CurseOfVanishing) CompatibleWithEnchantment(t item.EnchantmentType) bool {
return true
}
// CompatibleWithItem ...
func (CurseOfVanishing) CompatibleWithItem(i world.Item) bool {
_, arm := i.(item.Armour)
_, com := i.(item.Compass)
_, dur := i.(item.Durable)
_, rec := i.(item.RecoveryCompass)
// TODO: Carrot on a Stick
// TODO: Warped Fungus on a Stick
return arm || com || dur || rec
}
// Treasure ...
func (CurseOfVanishing) Treasure() bool {
return true
}
// Curse ...
func (CurseOfVanishing) Curse() bool {
return true
}