effect

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 7 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ID

func ID(e Effect) (int, bool)

ID attempts to return the ID an effect was registered with. If found, the id is returned and the bool true.

func Register

func Register(id int, e Effect)

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

func ResultingColour

func ResultingColour(effects []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 world.Entity)

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(world.Entity)

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 world.Entity)

Start ...

func (Absorption) Stop

func (a Absorption) Stop(e world.Entity)

Stop ...

func (Absorption) WithSettings

func (a Absorption) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Blindness) WithSettings

func (b Blindness) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (ConduitPower) WithSettings

func (c ConduitPower) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

type Effect

type Effect interface {
	// Instant checks if the effect is instance. If it is instant, the effect will only be ticked a single
	// time when added to an entity.
	Instant() bool
	// Apply applies the effect to an entity. For instant effects, this method applies the effect once, such
	// as healing the world.Entity for instant health.
	Apply(e world.Entity)
	// Level returns the level of the effect. A higher level generally means a more powerful effect.
	Level() int
	// Duration returns the leftover duration of the effect.
	Duration() time.Duration
	// WithSettings returns the effect with a duration and level passed.
	WithSettings(d time.Duration, level int, ambient bool) Effect
	// RGBA returns the colour of the effect. If multiple effects are present, the colours will be mixed
	// together to form a new colour.
	RGBA() color.RGBA
	// ShowParticles checks if the particle should show particles. If not, entities that have the effect
	// will not display particles around them.
	ShowParticles() bool
	// AmbientSource specifies if the effect came from an ambient source, such as a beacon or conduit. The
	// particles will be less visible when this is true.
	AmbientSource() bool
	// Start is called for lasting events. It is sent the first time the effect is applied to an entity.
	Start(e world.Entity)
	// End is called for lasting events. It is sent the moment the effect expires.
	End(e world.Entity)
}

Effect represents an effect that may be added to a living entity. Effects may either be instant or last for a specific duration.

func ByID

func ByID(id int) (Effect, bool)

ByID attempts to return an effect by the ID it was registered with. If found, the effect found is returned and the bool true.

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (FatalPoison) WithSettings

func (p FatalPoison) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

type FireResistance

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

FireResistance is a lasting effect that grants immunity to fire & lava damage.

func (FireResistance) AmbientSource

func (l FireResistance) AmbientSource() bool

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

func (FireResistance) Apply

func (FireResistance) Apply(living world.Entity)

Apply ...

func (FireResistance) Duration

func (l FireResistance) Duration() time.Duration

Duration returns the leftover duration of the lasting effect.

func (FireResistance) End

func (FireResistance) End(world.Entity)

End ...

func (FireResistance) Instant

func (FireResistance) Instant() bool

Instant always returns false for lasting effects.

func (FireResistance) Level

func (l FireResistance) Level() int

Level returns the level of the lasting effect.

func (FireResistance) RGBA

func (f FireResistance) RGBA() color.RGBA

RGBA ...

func (FireResistance) ShowParticles

func (l FireResistance) ShowParticles() bool

ShowParticles returns true if the effect does not display particles.

func (FireResistance) Start

func (FireResistance) Start(world.Entity)

Start ...

func (FireResistance) WithSettings

func (f FireResistance) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Haste) WithSettings

func (h Haste) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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 world.Entity)

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 world.Entity)

Start ...

func (HealthBoost) WithSettings

func (h HealthBoost) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Hunger) WithSettings

func (h Hunger) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

Apply ...

func (InstantDamage) Duration

func (InstantDamage) Duration() time.Duration

Duration always returns 0 for instant effects.

func (InstantDamage) End

func (InstantDamage) End(world.Entity)

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(world.Entity)

Start ...

func (InstantDamage) WithSettings

func (i InstantDamage) WithSettings(_ time.Duration, level int, _ bool) Effect

WithSettings ...

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 world.Entity)

Apply instantly heals the world.Entity 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(world.Entity)

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(world.Entity)

Start ...

func (InstantHealth) WithSettings

func (i InstantHealth) WithSettings(_ time.Duration, level int, _ bool) Effect

WithSettings ...

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 world.Entity)

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 world.Entity)

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 world.Entity)

Start ...

func (Invisibility) WithSettings

func (i Invisibility) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (JumpBoost) WithSettings

func (j JumpBoost) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Levitation) WithSettings

func (l Levitation) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (MiningFatigue) WithSettings

func (m MiningFatigue) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Nausea) WithSettings

func (n Nausea) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (NightVision) WithSettings

func (n NightVision) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Poison) WithSettings

func (p Poison) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

Apply applies health to the world.Entity 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(world.Entity)

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(world.Entity)

Start ...

func (Regeneration) WithSettings

func (r Regeneration) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Resistance) WithSettings

func (r Resistance) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Saturation) WithSettings

func (s Saturation) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (SlowFalling) WithSettings

func (s SlowFalling) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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 world.Entity)

Start ...

func (Slowness) Stop

func (s Slowness) Stop(e world.Entity)

Stop ...

func (Slowness) WithSettings

func (s Slowness) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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 world.Entity)

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 world.Entity)

Start ...

func (Speed) WithSettings

func (s Speed) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Strength) WithSettings

func (s Strength) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (WaterBreathing) WithSettings

func (w WaterBreathing) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Weakness) WithSettings

func (w Weakness) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

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 world.Entity)

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(world.Entity)

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(world.Entity)

Start ...

func (Wither) WithSettings

func (w Wither) WithSettings(d time.Duration, level int, ambient bool) Effect

WithSettings ...

Jump to

Keyboard shortcuts

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