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

This commit is contained in:
2026-07-09 08:33:57 +08:00
commit 26ed99fda6
845 changed files with 75419 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
package enchantment
import (
"github.com/df-mc/dragonfly/server/item"
"github.com/df-mc/dragonfly/server/world"
"time"
)
// FireAspect is a sword enchantment that sets the target on fire.
var FireAspect fireAspect
type fireAspect struct{}
// Name ...
func (fireAspect) Name() string {
return "Fire Aspect"
}
// MaxLevel ...
func (fireAspect) MaxLevel() int {
return 2
}
// Cost ...
func (fireAspect) Cost(level int) (int, int) {
minCost := 10 + (level-1)*20
return minCost, minCost + 50
}
// Rarity ...
func (fireAspect) Rarity() item.EnchantmentRarity {
return item.EnchantmentRarityRare
}
// Duration returns how long the fire from fire aspect will last.
func (fireAspect) Duration(level int) time.Duration {
return time.Second * 4 * time.Duration(level)
}
// CompatibleWithEnchantment ...
func (fireAspect) CompatibleWithEnchantment(item.EnchantmentType) bool {
return true
}
// CompatibleWithItem ...
func (fireAspect) CompatibleWithItem(i world.Item) bool {
t, ok := i.(item.Tool)
return ok && t.ToolType() == item.TypeSword
}