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

     1  package effect
     2  
     3  import (
     4  	"image/color"
     5  )
     6  
     7  // Weakness is a lasting effect that reduces the damage dealt to other entities with melee attacks.
     8  type Weakness struct {
     9  	nopLasting
    10  }
    11  
    12  // Multiplier returns the damage multiplier of the effect.
    13  func (Weakness) Multiplier(lvl int) float64 {
    14  	v := 0.2 * float64(lvl)
    15  	if v > 1 {
    16  		v = 1
    17  	}
    18  	return v
    19  }
    20  
    21  // RGBA ...
    22  func (Weakness) RGBA() color.RGBA {
    23  	return color.RGBA{R: 0x48, G: 0x4d, B: 0x48, A: 0xff}
    24  }