up3
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
Build and deploy / Build (push) Has been cancelled
Build and deploy / Update Contributors (push) Has been cancelled
Build and deploy / Deploy (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package enchantment
|
||||
|
||||
import (
|
||||
"github.com/df-mc/dragonfly/server/item"
|
||||
"github.com/df-mc/dragonfly/server/world"
|
||||
)
|
||||
|
||||
// Piercing is an enchantment that allows arrows to damage and pierce through multiple entities, including shields.
|
||||
var Piercing piercing
|
||||
|
||||
type piercing struct{}
|
||||
|
||||
func (p piercing) Name() string {
|
||||
return "Piercing"
|
||||
}
|
||||
|
||||
func (p piercing) MaxLevel() int {
|
||||
return 4
|
||||
}
|
||||
|
||||
func (p piercing) Cost(level int) (int, int) {
|
||||
return 1 + (level-1)*10, 50
|
||||
}
|
||||
|
||||
func (p piercing) Rarity() item.EnchantmentRarity {
|
||||
return item.EnchantmentRarityCommon
|
||||
}
|
||||
|
||||
func (p piercing) CompatibleWithEnchantment(t item.EnchantmentType) bool {
|
||||
return t != Multishot
|
||||
}
|
||||
|
||||
func (p piercing) CompatibleWithItem(i world.Item) bool {
|
||||
_, ok := i.(item.Crossbow)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (p piercing) Pierces() bool {
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user