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,33 @@
|
||||
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}
|
||||
}
|
||||
Reference in New Issue
Block a user