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
+37
View File
@@ -0,0 +1,37 @@
package effect
import (
"github.com/df-mc/dragonfly/server/world"
"image/color"
)
// Absorption is a lasting effect that increases the health of an entity over
// the maximum. Once this extra health is lost, it will not regenerate.
var Absorption absorption
type absorption struct {
nopLasting
}
// Start ...
func (absorption) Start(e world.Entity, lvl int) {
if i, ok := e.(interface {
SetAbsorption(health float64)
}); ok {
i.SetAbsorption(4 * float64(lvl))
}
}
// End ...
func (absorption) End(e world.Entity, _ int) {
if i, ok := e.(interface {
SetAbsorption(health float64)
}); ok {
i.SetAbsorption(0)
}
}
// RGBA ...
func (absorption) RGBA() color.RGBA {
return color.RGBA{R: 0x25, G: 0x52, B: 0xa5, A: 0xff}
}