Files
mc/server/entity/effect/health_boost.go
T
TarnaWijaya 26ed99fda6
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
up3
2026-07-09 08:33:57 +08:00

34 lines
665 B
Go

package effect
import (
"github.com/df-mc/dragonfly/server/world"
"image/color"
)
// HealthBoost causes the affected entity to have its maximum health changed
// for a specific duration.
var HealthBoost healthBoost
type healthBoost struct {
nopLasting
}
// Start ...
func (healthBoost) Start(e world.Entity, lvl int) {
if l, ok := e.(living); ok {
l.SetMaxHealth(l.MaxHealth() + 4*float64(lvl))
}
}
// End ...
func (healthBoost) End(e world.Entity, lvl int) {
if l, ok := e.(living); ok {
l.SetMaxHealth(l.MaxHealth() - 4*float64(lvl))
}
}
// RGBA ...
func (healthBoost) RGBA() color.RGBA {
return color.RGBA{R: 0xf8, G: 0x7d, B: 0x23, A: 0xff}
}