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
+35
View File
@@ -0,0 +1,35 @@
package effect
import (
"github.com/df-mc/dragonfly/server/world"
"image/color"
)
// Speed is a lasting effect that increases the speed of an entity by 20% for
// each level that the effect has.
var Speed speed
type speed struct {
nopLasting
}
// Start ...
func (speed) Start(e world.Entity, lvl int) {
speed := 1 + float64(lvl)*0.2
if l, ok := e.(living); ok {
l.SetSpeed(l.Speed() * speed)
}
}
// End ...
func (speed) End(e world.Entity, lvl int) {
speed := 1 + float64(lvl)*0.2
if l, ok := e.(living); ok {
l.SetSpeed(l.Speed() / speed)
}
}
// RGBA ...
func (speed) RGBA() color.RGBA {
return color.RGBA{R: 0x33, G: 0xeb, B: 0xff, A: 0xff}
}