github.com/df-mc/dragonfly@v0.9.13/server/entity/effect/conduit_power.go (about)

     1  package effect
     2  
     3  import (
     4  	"image/color"
     5  )
     6  
     7  // ConduitPower is a lasting effect that grants the affected entity the ability to breathe underwater and
     8  // allows the entity to break faster when underwater or in the rain. (Similarly to haste.)
     9  type ConduitPower struct {
    10  	nopLasting
    11  }
    12  
    13  // Multiplier returns the mining speed multiplier from this effect.
    14  func (ConduitPower) Multiplier(lvl int) float64 {
    15  	v := 1 - float64(lvl)*0.1
    16  	if v < 0 {
    17  		v = 0
    18  	}
    19  	return v
    20  }
    21  
    22  // RGBA ...
    23  func (ConduitPower) RGBA() color.RGBA {
    24  	return color.RGBA{R: 0x1d, G: 0xc2, B: 0xd1, A: 0xff}
    25  }