effect

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(id int, e entity.Effect)

Register registers an entity.Effect with a specific ID to translate from and to on disk and network. An entity.Effect instance may be created by creating a struct instance in this package like effect.Regeneration{}.

func ResultingColour

func ResultingColour(effects []entity.Effect) (color.RGBA, bool)

ResultingColour calculates the resulting colour of the effects passed and returns a bool specifying if the effects were ambient effects, which will cause their particles to display less frequently.

Types

type Absorption

type Absorption struct {
	// contains filtered or unexported fields
}

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.

func (Absorption) Absorbs

func (a Absorption) Absorbs(src damage.Source) bool

Absorbs checks if Absorption absorbs the damage source passed.

func (Absorption) AmbientSource

func (l Absorption) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Absorption) Apply

func (Absorption) Apply(living entity.Living)

Apply ...

func (Absorption) Duration

func (l Absorption) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Absorption) End

func (Absorption) End(entity.Living)

End ...

func (Absorption) Instant

func (Absorption) Instant() bool

Instant always returns false for lasting effects.

func (Absorption) Level

func (l Absorption) Level() int

Level returns the level of the lasting effect.

func (Absorption) RGBA

func (a Absorption) RGBA() color.RGBA

RGBA ...

func (Absorption) ShowParticles

func (l Absorption) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Absorption) Start

func (a Absorption) Start(e entity.Living)

Start ...

func (Absorption) Stop

func (a Absorption) Stop(e entity.Living)

Stop ...

func (Absorption) WithDuration

func (a Absorption) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Blindness

type Blindness struct {
	// contains filtered or unexported fields
}

Blindness is a lasting effect that greatly reduces the vision range of the entity affected.

func (Blindness) AmbientSource

func (l Blindness) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Blindness) Apply

func (Blindness) Apply(living entity.Living)

Apply ...

func (Blindness) Duration

func (l Blindness) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Blindness) End

func (Blindness) End(entity.Living)

End ...

func (Blindness) Instant

func (Blindness) Instant() bool

Instant always returns false for lasting effects.

func (Blindness) Level

func (l Blindness) Level() int

Level returns the level of the lasting effect.

func (Blindness) RGBA

func (Blindness) RGBA() color.RGBA

RGBA ...

func (Blindness) ShowParticles

func (l Blindness) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Blindness) Start

func (Blindness) Start(entity.Living)

Start ...

func (Blindness) WithDuration

func (b Blindness) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type ConduitPower

type ConduitPower struct {
	// contains filtered or unexported fields
}

ConduitPower is a lasting effect that grants the affected entity the ability to breathe underwater and allows the entity to break faster when underwater or in the rain. (Similarly to haste.)

func (ConduitPower) AmbientSource

func (l ConduitPower) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (ConduitPower) Apply

func (ConduitPower) Apply(living entity.Living)

Apply ...

func (ConduitPower) Duration

func (l ConduitPower) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (ConduitPower) End

func (ConduitPower) End(entity.Living)

End ...

func (ConduitPower) Instant

func (ConduitPower) Instant() bool

Instant always returns false for lasting effects.

func (ConduitPower) Level

func (l ConduitPower) Level() int

Level returns the level of the lasting effect.

func (ConduitPower) Multiplier

func (c ConduitPower) Multiplier() float64

Multiplier returns the mining speed multiplier from this effect.

func (ConduitPower) RGBA

func (c ConduitPower) RGBA() color.RGBA

RGBA ...

func (ConduitPower) ShowParticles

func (l ConduitPower) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (ConduitPower) Start

func (ConduitPower) Start(entity.Living)

Start ...

func (ConduitPower) WithDuration

func (c ConduitPower) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type FatalPoison

type FatalPoison struct {
	// contains filtered or unexported fields
}

FatalPoison is a lasting effect that causes the affected entity to lose health gradually. FatalPoison, unlike Poison, can kill the entity it is applied to.

func (FatalPoison) AmbientSource

func (l FatalPoison) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (FatalPoison) Apply

func (p FatalPoison) Apply(e entity.Living)

Apply ...

func (FatalPoison) Duration

func (l FatalPoison) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (FatalPoison) End

func (FatalPoison) End(entity.Living)

End ...

func (FatalPoison) Instant

func (FatalPoison) Instant() bool

Instant always returns false for lasting effects.

func (FatalPoison) Level

func (l FatalPoison) Level() int

Level returns the level of the lasting effect.

func (FatalPoison) RGBA

func (p FatalPoison) RGBA() color.RGBA

RGBA ...

func (FatalPoison) ShowParticles

func (l FatalPoison) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (FatalPoison) Start

func (FatalPoison) Start(entity.Living)

Start ...

func (FatalPoison) WithDuration

func (p FatalPoison) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Haste

type Haste struct {
	// contains filtered or unexported fields
}

Haste is a lasting effect that increases the mining speed of a player by 20% for each level of the effect.

func (Haste) AmbientSource

func (l Haste) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Haste) Apply

func (Haste) Apply(living entity.Living)

Apply ...

func (Haste) Duration

func (l Haste) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Haste) End

func (Haste) End(entity.Living)

End ...

func (Haste) Instant

func (Haste) Instant() bool

Instant always returns false for lasting effects.

func (Haste) Level

func (l Haste) Level() int

Level returns the level of the lasting effect.

func (Haste) Multiplier

func (h Haste) Multiplier() float64

Multiplier returns the mining speed multiplier from this effect.

func (Haste) RGBA

func (Haste) RGBA() color.RGBA

RGBA ...

func (Haste) ShowParticles

func (l Haste) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Haste) Start

func (Haste) Start(entity.Living)

Start ...

func (Haste) WithDuration

func (h Haste) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type HealthBoost

type HealthBoost struct {
	// contains filtered or unexported fields
}

HealthBoost causes the affected entity to have its maximum health changed for a specific duration.

func (HealthBoost) AmbientSource

func (l HealthBoost) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (HealthBoost) Apply

func (HealthBoost) Apply(living entity.Living)

Apply ...

func (HealthBoost) Duration

func (l HealthBoost) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (HealthBoost) End

func (h HealthBoost) End(e entity.Living)

End ...

func (HealthBoost) Instant

func (HealthBoost) Instant() bool

Instant always returns false for lasting effects.

func (HealthBoost) Level

func (l HealthBoost) Level() int

Level returns the level of the lasting effect.

func (HealthBoost) RGBA

func (HealthBoost) RGBA() color.RGBA

RGBA ...

func (HealthBoost) ShowParticles

func (l HealthBoost) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (HealthBoost) Start

func (h HealthBoost) Start(e entity.Living)

Start ...

func (HealthBoost) WithDuration

func (h HealthBoost) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Hunger

type Hunger struct {
	// contains filtered or unexported fields
}

Hunger is a lasting effect that causes an affected player to gradually lose saturation and food.

func (Hunger) AmbientSource

func (l Hunger) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Hunger) Apply

func (h Hunger) Apply(e entity.Living)

Apply ...

func (Hunger) Duration

func (l Hunger) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Hunger) End

func (Hunger) End(entity.Living)

End ...

func (Hunger) Instant

func (Hunger) Instant() bool

Instant always returns false for lasting effects.

func (Hunger) Level

func (l Hunger) Level() int

Level returns the level of the lasting effect.

func (Hunger) RGBA

func (Hunger) RGBA() color.RGBA

RGBA ...

func (Hunger) ShowParticles

func (l Hunger) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Hunger) Start

func (Hunger) Start(entity.Living)

Start ...

func (Hunger) WithDuration

func (h Hunger) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type InstantDamage

type InstantDamage struct {

	// Potency specifies the potency of the instant damage. By default this value is 1, which means 100% of
	// the instant damage will be applied to an entity. A lingering damage potion, for example, has a potency
	// of 0.5: It deals 1.5 hearts damage (per tick) instead of 3.
	Potency float64
	// contains filtered or unexported fields
}

InstantDamage is an instant effect that causes a living entity to immediately take some damage, depending on the level and the potency of the effect.

func (InstantDamage) AmbientSource

func (InstantDamage) AmbientSource() bool

AmbientSource always returns false for instant effects.

func (InstantDamage) Apply

func (i InstantDamage) Apply(e entity.Living)

Apply ...

func (InstantDamage) Duration

func (InstantDamage) Duration() time.Duration

Duration always returns 0 for instant effects.

func (InstantDamage) End

func (InstantDamage) End(entity.Living)

End ...

func (InstantDamage) Instant

func (InstantDamage) Instant() bool

Instant always returns true for instant effects.

func (InstantDamage) Level

func (i InstantDamage) Level() int

Level returns the level of the instant effect.

func (InstantDamage) RGBA

func (InstantDamage) RGBA() color.RGBA

RGBA always returns an empty color.RGBA.

func (InstantDamage) ShowParticles

func (InstantDamage) ShowParticles() bool

ShowParticles always returns false for instant effects.

func (InstantDamage) Start

func (InstantDamage) Start(entity.Living)

Start ...

func (InstantDamage) WithDuration

func (i InstantDamage) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type InstantHealth

type InstantHealth struct {

	// Potency specifies the potency of the instant health. By default this value is 1, which means 100% of
	// the instant health will be applied to an entity. A lingering health potion, for example, has a potency
	// of 0.5: It heals 1 heart (per tick) instead of 2.
	Potency float64
	// contains filtered or unexported fields
}

InstantHealth is an instant effect that causes the player that it is applied to to immediately regain some health. The amount of health regained depends on the effect level and potency.

func (InstantHealth) AmbientSource

func (InstantHealth) AmbientSource() bool

AmbientSource always returns false for instant effects.

func (InstantHealth) Apply

func (i InstantHealth) Apply(e entity.Living)

Apply instantly heals the entity.Living passed for a bit of health, depending on the effect level and potency.

func (InstantHealth) Duration

func (InstantHealth) Duration() time.Duration

Duration always returns 0 for instant effects.

func (InstantHealth) End

func (InstantHealth) End(entity.Living)

End ...

func (InstantHealth) Instant

func (InstantHealth) Instant() bool

Instant always returns true for instant effects.

func (InstantHealth) Level

func (i InstantHealth) Level() int

Level returns the level of the instant effect.

func (InstantHealth) RGBA

func (InstantHealth) RGBA() color.RGBA

RGBA always returns an empty color.RGBA.

func (InstantHealth) ShowParticles

func (InstantHealth) ShowParticles() bool

ShowParticles always returns false for instant effects.

func (InstantHealth) Start

func (InstantHealth) Start(entity.Living)

Start ...

func (InstantHealth) WithDuration

func (i InstantHealth) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Invisibility

type Invisibility struct {
	// contains filtered or unexported fields
}

Invisibility is a lasting effect that causes the affected entity to turn invisible. While invisible, the entity's armour is still visible and effect particles will still be displayed.

func (Invisibility) AmbientSource

func (l Invisibility) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Invisibility) Apply

func (Invisibility) Apply(living entity.Living)

Apply ...

func (Invisibility) Duration

func (l Invisibility) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Invisibility) End

func (Invisibility) End(e entity.Living)

End ...

func (Invisibility) Instant

func (Invisibility) Instant() bool

Instant always returns false for lasting effects.

func (Invisibility) Level

func (l Invisibility) Level() int

Level returns the level of the lasting effect.

func (Invisibility) RGBA

func (Invisibility) RGBA() color.RGBA

RGBA ...

func (Invisibility) ShowParticles

func (l Invisibility) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Invisibility) Start

func (Invisibility) Start(e entity.Living)

Start ...

func (Invisibility) WithDuration

func (i Invisibility) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type JumpBoost

type JumpBoost struct {
	// contains filtered or unexported fields
}

JumpBoost is a lasting effect that causes the affected entity to be able to jump much higher, depending on the level of the effect.

func (JumpBoost) AmbientSource

func (l JumpBoost) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (JumpBoost) Apply

func (JumpBoost) Apply(living entity.Living)

Apply ...

func (JumpBoost) Duration

func (l JumpBoost) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (JumpBoost) End

func (JumpBoost) End(entity.Living)

End ...

func (JumpBoost) Instant

func (JumpBoost) Instant() bool

Instant always returns false for lasting effects.

func (JumpBoost) Level

func (l JumpBoost) Level() int

Level returns the level of the lasting effect.

func (JumpBoost) RGBA

func (JumpBoost) RGBA() color.RGBA

RGBA ...

func (JumpBoost) ShowParticles

func (l JumpBoost) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (JumpBoost) Start

func (JumpBoost) Start(entity.Living)

Start ...

func (JumpBoost) WithDuration

func (j JumpBoost) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Levitation

type Levitation struct {
	// contains filtered or unexported fields
}

Levitation is a lasting effect that causes the affected entity to slowly levitate upwards. It is roughly the opposite of the SlowFalling effect.

func (Levitation) AmbientSource

func (l Levitation) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Levitation) Apply

func (Levitation) Apply(living entity.Living)

Apply ...

func (Levitation) Duration

func (l Levitation) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Levitation) End

func (Levitation) End(entity.Living)

End ...

func (Levitation) Instant

func (Levitation) Instant() bool

Instant always returns false for lasting effects.

func (Levitation) Level

func (l Levitation) Level() int

Level returns the level of the lasting effect.

func (Levitation) RGBA

func (Levitation) RGBA() color.RGBA

RGBA ...

func (Levitation) ShowParticles

func (l Levitation) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Levitation) Start

func (Levitation) Start(entity.Living)

Start ...

func (Levitation) WithDuration

func (l Levitation) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type MiningFatigue

type MiningFatigue struct {
	// contains filtered or unexported fields
}

MiningFatigue is a lasting effect that decreases the mining speed of a player by 10% for each level of the effect.

func (MiningFatigue) AmbientSource

func (l MiningFatigue) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (MiningFatigue) Apply

func (MiningFatigue) Apply(living entity.Living)

Apply ...

func (MiningFatigue) Duration

func (l MiningFatigue) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (MiningFatigue) End

func (MiningFatigue) End(entity.Living)

End ...

func (MiningFatigue) Instant

func (MiningFatigue) Instant() bool

Instant always returns false for lasting effects.

func (MiningFatigue) Level

func (l MiningFatigue) Level() int

Level returns the level of the lasting effect.

func (MiningFatigue) Multiplier

func (m MiningFatigue) Multiplier() float64

Multiplier returns the mining speed multiplier from this effect.

func (MiningFatigue) RGBA

func (MiningFatigue) RGBA() color.RGBA

RGBA ...

func (MiningFatigue) ShowParticles

func (l MiningFatigue) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (MiningFatigue) Start

func (MiningFatigue) Start(entity.Living)

Start ...

func (MiningFatigue) WithDuration

func (m MiningFatigue) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Nausea

type Nausea struct {
	// contains filtered or unexported fields
}

Nausea is a lasting effect that causes the screen to warp, similarly to when entering a nether portal.

func (Nausea) AmbientSource

func (l Nausea) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Nausea) Apply

func (Nausea) Apply(living entity.Living)

Apply ...

func (Nausea) Duration

func (l Nausea) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Nausea) End

func (Nausea) End(entity.Living)

End ...

func (Nausea) Instant

func (Nausea) Instant() bool

Instant always returns false for lasting effects.

func (Nausea) Level

func (l Nausea) Level() int

Level returns the level of the lasting effect.

func (Nausea) RGBA

func (Nausea) RGBA() color.RGBA

RGBA ...

func (Nausea) ShowParticles

func (l Nausea) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Nausea) Start

func (Nausea) Start(entity.Living)

Start ...

func (Nausea) WithDuration

func (n Nausea) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type NightVision

type NightVision struct {
	// contains filtered or unexported fields
}

NightVision is a lasting effect that causes the affected entity to see in dark places as though they were fully lit up.

func (NightVision) AmbientSource

func (l NightVision) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (NightVision) Apply

func (NightVision) Apply(living entity.Living)

Apply ...

func (NightVision) Duration

func (l NightVision) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (NightVision) End

func (NightVision) End(entity.Living)

End ...

func (NightVision) Instant

func (NightVision) Instant() bool

Instant always returns false for lasting effects.

func (NightVision) Level

func (l NightVision) Level() int

Level returns the level of the lasting effect.

func (NightVision) RGBA

func (NightVision) RGBA() color.RGBA

RGBA ...

func (NightVision) ShowParticles

func (l NightVision) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (NightVision) Start

func (NightVision) Start(entity.Living)

Start ...

func (NightVision) WithDuration

func (n NightVision) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Poison

type Poison struct {
	// contains filtered or unexported fields
}

Poison is a lasting effect that causes the affected entity to lose health gradually. Poison cannot kill, unlike FatalPoison.

func (Poison) AmbientSource

func (l Poison) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Poison) Apply

func (p Poison) Apply(e entity.Living)

Apply ...

func (Poison) Duration

func (l Poison) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Poison) End

func (Poison) End(entity.Living)

End ...

func (Poison) Instant

func (Poison) Instant() bool

Instant always returns false for lasting effects.

func (Poison) Level

func (l Poison) Level() int

Level returns the level of the lasting effect.

func (Poison) RGBA

func (p Poison) RGBA() color.RGBA

RGBA ...

func (Poison) ShowParticles

func (l Poison) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Poison) Start

func (Poison) Start(entity.Living)

Start ...

func (Poison) WithDuration

func (p Poison) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Regeneration

type Regeneration struct {
	// contains filtered or unexported fields
}

Regeneration is an effect that causes the entity that it is added to to slowly regenerate health. The level of the effect influences the speed with which the entity regenerates.

func (Regeneration) AmbientSource

func (l Regeneration) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Regeneration) Apply

func (r Regeneration) Apply(e entity.Living)

Apply applies health to the entity.Living passed if the duration of the effect is at the right tick.

func (Regeneration) Duration

func (l Regeneration) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Regeneration) End

func (Regeneration) End(entity.Living)

End ...

func (Regeneration) Instant

func (Regeneration) Instant() bool

Instant always returns false for lasting effects.

func (Regeneration) Level

func (l Regeneration) Level() int

Level returns the level of the lasting effect.

func (Regeneration) RGBA

func (Regeneration) RGBA() color.RGBA

RGBA ...

func (Regeneration) ShowParticles

func (l Regeneration) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Regeneration) Start

func (Regeneration) Start(entity.Living)

Start ...

func (Regeneration) WithDuration

func (r Regeneration) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Resistance

type Resistance struct {
	// contains filtered or unexported fields
}

Resistance is a lasting effect that reduces the damage taken from any sources except for void damage or custom damage.

func (Resistance) AmbientSource

func (l Resistance) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Resistance) Apply

func (Resistance) Apply(living entity.Living)

Apply ...

func (Resistance) Duration

func (l Resistance) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Resistance) End

func (Resistance) End(entity.Living)

End ...

func (Resistance) Instant

func (Resistance) Instant() bool

Instant always returns false for lasting effects.

func (Resistance) Level

func (l Resistance) Level() int

Level returns the level of the lasting effect.

func (Resistance) Multiplier

func (r Resistance) Multiplier(e damage.Source) float64

Multiplier returns a damage multiplier for the damage source passed.

func (Resistance) RGBA

func (Resistance) RGBA() color.RGBA

RGBA ...

func (Resistance) ShowParticles

func (l Resistance) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Resistance) Start

func (Resistance) Start(entity.Living)

Start ...

func (Resistance) WithDuration

func (r Resistance) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Saturation

type Saturation struct {
	// contains filtered or unexported fields
}

Saturation is a lasting effect that causes the affected player to regain food and saturation.

func (Saturation) AmbientSource

func (l Saturation) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Saturation) Apply

func (s Saturation) Apply(e entity.Living)

Apply ...

func (Saturation) Duration

func (l Saturation) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Saturation) End

func (Saturation) End(entity.Living)

End ...

func (Saturation) Instant

func (Saturation) Instant() bool

Instant always returns false for lasting effects.

func (Saturation) Level

func (l Saturation) Level() int

Level returns the level of the lasting effect.

func (Saturation) RGBA

func (s Saturation) RGBA() color.RGBA

RGBA ...

func (Saturation) ShowParticles

func (l Saturation) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Saturation) Start

func (Saturation) Start(entity.Living)

Start ...

func (Saturation) WithDuration

func (s Saturation) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type SlowFalling

type SlowFalling struct {
	// contains filtered or unexported fields
}

SlowFalling is a lasting effect that causes the affected entity to fall very slowly.

func (SlowFalling) AmbientSource

func (l SlowFalling) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (SlowFalling) Apply

func (SlowFalling) Apply(living entity.Living)

Apply ...

func (SlowFalling) Duration

func (l SlowFalling) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (SlowFalling) End

func (SlowFalling) End(entity.Living)

End ...

func (SlowFalling) Instant

func (SlowFalling) Instant() bool

Instant always returns false for lasting effects.

func (SlowFalling) Level

func (l SlowFalling) Level() int

Level returns the level of the lasting effect.

func (SlowFalling) RGBA

func (SlowFalling) RGBA() color.RGBA

RGBA ...

func (SlowFalling) ShowParticles

func (l SlowFalling) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (SlowFalling) Start

func (SlowFalling) Start(entity.Living)

Start ...

func (SlowFalling) WithDuration

func (s SlowFalling) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Slowness

type Slowness struct {
	// contains filtered or unexported fields
}

Slowness is a lasting effect that decreases the movement speed of a living entity by 15% for each level that the effect has.

func (Slowness) AmbientSource

func (l Slowness) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Slowness) Apply

func (Slowness) Apply(living entity.Living)

Apply ...

func (Slowness) Duration

func (l Slowness) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Slowness) End

func (Slowness) End(entity.Living)

End ...

func (Slowness) Instant

func (Slowness) Instant() bool

Instant always returns false for lasting effects.

func (Slowness) Level

func (l Slowness) Level() int

Level returns the level of the lasting effect.

func (Slowness) RGBA

func (Slowness) RGBA() color.RGBA

RGBA ...

func (Slowness) ShowParticles

func (l Slowness) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Slowness) Start

func (s Slowness) Start(e entity.Living)

Start ...

func (Slowness) Stop

func (s Slowness) Stop(e entity.Living)

Stop ...

func (Slowness) WithDuration

func (s Slowness) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Speed

type Speed struct {
	// contains filtered or unexported fields
}

Speed is a lasting effect that increases the speed of an entity by 20% for each level that the effect has.

func (Speed) AmbientSource

func (l Speed) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Speed) Apply

func (Speed) Apply(living entity.Living)

Apply ...

func (Speed) Duration

func (l Speed) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Speed) End

func (s Speed) End(e entity.Living)

End ...

func (Speed) Instant

func (Speed) Instant() bool

Instant always returns false for lasting effects.

func (Speed) Level

func (l Speed) Level() int

Level returns the level of the lasting effect.

func (Speed) RGBA

func (Speed) RGBA() color.RGBA

RGBA ...

func (Speed) ShowParticles

func (l Speed) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Speed) Start

func (s Speed) Start(e entity.Living)

Start ...

func (Speed) WithDuration

func (s Speed) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Strength

type Strength struct {
	// contains filtered or unexported fields
}

Strength is a lasting effect that increases the damage dealt with melee attacks when applied to an entity.

func (Strength) AmbientSource

func (l Strength) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Strength) Apply

func (Strength) Apply(living entity.Living)

Apply ...

func (Strength) Duration

func (l Strength) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Strength) End

func (Strength) End(entity.Living)

End ...

func (Strength) Instant

func (Strength) Instant() bool

Instant always returns false for lasting effects.

func (Strength) Level

func (l Strength) Level() int

Level returns the level of the lasting effect.

func (Strength) Multiplier

func (s Strength) Multiplier() float64

Multiplier returns the damage multiplier of the effect.

func (Strength) RGBA

func (Strength) RGBA() color.RGBA

RGBA ...

func (Strength) ShowParticles

func (l Strength) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Strength) Start

func (Strength) Start(entity.Living)

Start ...

func (Strength) WithDuration

func (s Strength) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type WaterBreathing

type WaterBreathing struct {
	// contains filtered or unexported fields
}

WaterBreathing is a lasting effect that allows the affected entity to breath underwater until the effect expires.

func (WaterBreathing) AmbientSource

func (l WaterBreathing) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (WaterBreathing) Apply

func (WaterBreathing) Apply(living entity.Living)

Apply ...

func (WaterBreathing) Duration

func (l WaterBreathing) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (WaterBreathing) End

func (WaterBreathing) End(entity.Living)

End ...

func (WaterBreathing) Instant

func (WaterBreathing) Instant() bool

Instant always returns false for lasting effects.

func (WaterBreathing) Level

func (l WaterBreathing) Level() int

Level returns the level of the lasting effect.

func (WaterBreathing) RGBA

func (w WaterBreathing) RGBA() color.RGBA

RGBA ...

func (WaterBreathing) ShowParticles

func (l WaterBreathing) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (WaterBreathing) Start

func (WaterBreathing) Start(entity.Living)

Start ...

func (WaterBreathing) WithDuration

func (w WaterBreathing) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Weakness

type Weakness struct {
	// contains filtered or unexported fields
}

Weakness is a lasting effect that reduces the damage dealt to other entities with melee attacks.

func (Weakness) AmbientSource

func (l Weakness) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Weakness) Apply

func (Weakness) Apply(living entity.Living)

Apply ...

func (Weakness) Duration

func (l Weakness) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Weakness) End

func (Weakness) End(entity.Living)

End ...

func (Weakness) Instant

func (Weakness) Instant() bool

Instant always returns false for lasting effects.

func (Weakness) Level

func (l Weakness) Level() int

Level returns the level of the lasting effect.

func (Weakness) Multiplier

func (w Weakness) Multiplier() float64

Multiplier returns the damage multiplier of the effect.

func (Weakness) RGBA

func (Weakness) RGBA() color.RGBA

RGBA ...

func (Weakness) ShowParticles

func (l Weakness) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Weakness) Start

func (Weakness) Start(entity.Living)

Start ...

func (Weakness) WithDuration

func (w Weakness) WithDuration(d time.Duration) entity.Effect

WithDuration ...

type Wither

type Wither struct {
	// contains filtered or unexported fields
}

Wither is a lasting effect that causes an entity to take continuous damage that is capable of killing an entity.

func (Wither) AmbientSource

func (l Wither) AmbientSource() bool

AmbientSource specifies if the effect comes from a beacon or conduit.

func (Wither) Apply

func (w Wither) Apply(e entity.Living)

Apply ...

func (Wither) Duration

func (l Wither) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (Wither) End

func (Wither) End(entity.Living)

End ...

func (Wither) Instant

func (Wither) Instant() bool

Instant always returns false for lasting effects.

func (Wither) Level

func (l Wither) Level() int

Level returns the level of the lasting effect.

func (Wither) RGBA

func (Wither) RGBA() color.RGBA

RGBA ...

func (Wither) ShowParticles

func (l Wither) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (Wither) Start

func (Wither) Start(entity.Living)

Start ...

func (Wither) WithDuration

func (w Wither) WithDuration(d time.Duration) entity.Effect

WithDuration ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL