GitHubGet started

package lightning

import "github.com/nsgo-dev/game/pkg/pixelfx/lightning"

Overview

Package lightning is pixelfx's lightning category: ball lightning, chain lightning, charge up, electrified, lightning strike, plasma ball, spark arc, storm cloud, tesla coil, thunderclap and zap hit, each a pixelfx.Effect registered as "lightning/<name>" when the package is imported.

Index

Variables

var BallLightning = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Ball lightning",
		Desc:     "A crackling ball of plasma drifts on a wandering loop, spitting arcs off its skin and leaving a wake of fading motes, and zaps the floor when it dips low.",
		Tags:     []string{"lightning", "electric", "plasma", "orb", "wisp", "ambient", "loop"},
		Size:     [2]int{136, 104},
		Origin:   [2]int{68, 92},
		Duration: 4,
		Loop:     true,
		FPS:      30,
		BG:       "ground",
		Options:  append(voltOptions(), pixelfx.Option{Name: "seed", Default: pixelfx.Num(9)}),
	},
	New: newBallLightning,
}

BallLightning is a crackling ball of plasma on a wandering loop, spitting arcs off its skin and shedding fading motes, that zaps the floor when it dips low. It is registered as "lightning/ball-lightning".

var ChainLightning = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Chain lightning",
		Desc:     "A bolt leaps from the caster's hand through three targets in turn; each flashes, sparks and grounds itself to the floor while the arcs between them flicker, then the chain snaps.",
		Tags:     []string{"lightning", "electric", "chain", "spell", "combat", "directional", "one-shot"},
		Size:     [2]int{248, 104},
		Origin:   [2]int{40, 82},
		Duration: 1.8,
		Loop:     false,
		FPS:      30,
		BG:       "ground",
		Actor:    2,
		Options:  append(voltOptions(), pixelfx.Option{Name: "seed", Default: pixelfx.Num(3)}),
	},
	Act: &pixelfx.Act{
		Targets: []float64{58, 104, 150},
		Poses: []pixelfx.Key{
			{T: -0.46, Pose: pixelfx.Ready.With(pixelfx.X.Is(-6))},
			{T: -0.22, Pose: clBack},
			{T: 0, Pose: clBack.With(pixelfx.Crouch.Is(5))},
			{T: 0.04, Pose: clAim, How: "snap"},
			{T: 0.7, Pose: clAim.With(pixelfx.Crouch.Is(3))},
			{T: 1.35, Pose: clAim.With(pixelfx.Crouch.Is(3), pixelfx.FY.Is(-18))},
			{T: 1.8, Pose: pixelfx.Ready.With(pixelfx.X.Is(-6))},
		},
		Hits: []pixelfx.Hit{
			clZap(0, 0.05, 0.03),
			clZap(1, 0.14, 0.03),
			func() pixelfx.Hit { h := clZap(2, 0.23, 0.07); h.Shake, h.Amp = 0.14, pixelfx.Val(1); return h }(),
			{T: 1.35, Push: pixelfx.Val(0), Straw: pixelfx.Val(0), Flash: pixelfx.Val(0), Skin: pixelfx.SkinNone},
		},
	},
	New: newChainLightning,
}

ChainLightning is a bolt leaping from the caster's hand through three targets in turn; each flashes, sparks and grounds itself to the floor while the arcs between them flicker, then the chain snaps. It is registered as "lightning/chain-lightning".

var ChargeUp = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Charge up",
		Desc:     "Sparks streak and arcs whip in to a crackling core at the caster's hand that swells and pulses faster, then it flashes and bursts: bolts every way, a ring, a spray of sparks.",
		Tags:     []string{"lightning", "electric", "charge", "spell", "power-up", "actor", "one-shot"},
		Size:     [2]int{272, 184},
		Origin:   [2]int{124, 148},
		Duration: 2.7,
		Loop:     false,
		FPS:      30,
		BG:       "ground",
		Actor:    2,
		Options: append(voltOptions(),
			pixelfx.Option{Name: "charge", Default: pixelfx.Num(1.6)},
			pixelfx.Option{Name: "seed", Default: pixelfx.Num(4)},
		),
	},
	Act: &pixelfx.Act{
		OnBody: true,
		Follow: pixelfx.Val(0),
		Poses: []pixelfx.Key{
			{T: -0.36, Pose: pixelfx.Ready},
			{T: 0, Pose: cuHold},
			{T: 0.8, Pose: cuHold.With(pixelfx.Crouch.Is(4))},
			{T: 1.4, Pose: cuHold.With(pixelfx.Crouch.Is(6), pixelfx.Lean.Is(0))},
			{T: 1.59, Pose: cuHold.With(pixelfx.Crouch.Is(7), pixelfx.Lean.Is(0))},
			{T: 1.6, Pose: cuBurst, How: "snap"},
			{T: 1.95, Pose: cuBurst.With(pixelfx.Y.Is(0), pixelfx.Crouch.Is(2), pixelfx.FY.Is(-30), pixelfx.BY.Is(-30), pixelfx.FFY.Is(-4), pixelfx.FBY.Is(-4))},
			{T: 2.7, Pose: pixelfx.Ready},
		},
		Hits: []pixelfx.Hit{{T: 1.6, Stop: 0.14, Shake: 0.3, Amp: pixelfx.Val(3)}},
		Dust: []pixelfx.DustKick{{T: 1.6, X: 10, N: 6, Dir: 1}, {T: 1.6, X: -10, N: 6, Dir: -1}},
	},
	New: newChargeUp,
}

ChargeUp is sparks streaking and arcs whipping in to a crackling core at the caster's hand that swells and pulses faster, then flashes and bursts: bolts every way, a ring, a spray of sparks. It is registered as "lightning/charge-up".

var Electrified = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Electrified",
		Desc:     "Current runs through a character: arcs crawl over and leap across the body, sparks spit off, the body flares to an electric silhouette on each jolt, and the feet ground out.",
		Tags:     []string{"lightning", "electric", "status", "shock", "stun", "actor", "loop"},
		Size:     [2]int{108, 92},
		Origin:   [2]int{54, 76},
		Duration: 2,
		Loop:     true,
		FPS:      30,
		BG:       "ground",
		Actor:    2,
		Options:  append(voltOptions(), pixelfx.Option{Name: "seed", Default: pixelfx.Num(5)}),
	},
	Act: &pixelfx.Act{
		OnBody: true,
		Poses: []pixelfx.Key{
			{T: 0, Pose: elTense},
			{T: 0.1, Pose: elJoltA, How: "snap"},
			{T: 0.17, Pose: elJoltB, How: "snap"},
			{T: 0.3, Pose: elTense, How: "snap"},
			{T: 0.733, Pose: elTense},
			{T: 0.733, Pose: elJoltB, How: "snap"},
			{T: 0.8, Pose: elJoltA, How: "snap"},
			{T: 0.93, Pose: elTense, How: "snap"},
			{T: 1.367, Pose: elTense},
			{T: 1.367, Pose: elJoltA, How: "snap"},
			{T: 1.45, Pose: elJoltB, How: "snap"},
			{T: 1.58, Pose: elTense, How: "snap"},
			{T: 2, Pose: elTense},
		},
	},
	New: newElectrified,
}

Electrified is current running through a character: arcs crawl over and leap across the body, sparks spit off, the body flares to an electric silhouette on each jolt, and the feet ground out. It is registered as "lightning/electrified".

var LightningStrike = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Lightning strike",
		Desc:     "A targeted strike: a sigil charges on the floor, the scene darkens, a thick bolt slams into it, arcs race out along the cracks it splits, the channel crumbles to a scorch.",
		Tags:     []string{"lightning", "electric", "strike", "spell", "target", "impact", "ground", "one-shot"},
		Size:     [2]int{240, 264},
		Origin:   [2]int{120, 228},
		Duration: 3,
		Loop:     false,
		FPS:      30,
		BG:       "ground",
		Options:  append(voltOptions(), pixelfx.Option{Name: "seed", Default: pixelfx.Num(5)}),
	},
	New: newLightningStrike,
}

LightningStrike is a targeted strike: a sigil charges on the floor, the scene darkens, a thick bolt slams into it, arcs race out along the cracks it splits, and the channel crumbles to a scorch. It is registered as "lightning/lightning-strike".

var PlasmaBall = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Plasma ball",
		Desc:     "A glass globe on a dark pedestal: wandering plasma tendrils reach from the core to the glass and fan out in bright feet where they touch it, lighting the stand and floor.",
		Tags:     []string{"lightning", "electric", "plasma", "lamp", "prop", "loop"},
		Size:     [2]int{112, 104},
		Origin:   [2]int{56, 96},
		Duration: 3,
		Loop:     true,
		FPS:      30,
		BG:       "ground",
		Options: []pixelfx.Option{
			{Name: "palette", Default: pixelfx.Palette("#1a0828", "#3b0f5e", "#6a1d9c", "#a03ad6", "#d46cf2", "#f2a8ff", "#ffe2ff", "#ffffff")},
			{Name: "tendrils", Default: pixelfx.Num(9)},
			{Name: "seed", Default: pixelfx.Num(6)},
		},
	},
	New: newPlasmaBall,
}

PlasmaBall is a glass globe on a dark pedestal whose wandering plasma tendrils reach from the core to the glass and fan out where they touch it, lighting the stand and floor. It is registered as "lightning/plasma-ball".

var SparkArc = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Spark arc",
		Desc:     "A climbing arc between two rods: it strikes white at their narrow foot, climbs on rising heat as it stretches and bows, sputters and snaps at the top, then strikes again.",
		Tags:     []string{"lightning", "electric", "arc", "jacobs-ladder", "machine", "prop", "loop"},
		Size:     [2]int{124, 120},
		Origin:   [2]int{62, 108},
		Duration: 2,
		Loop:     true,
		FPS:      30,
		BG:       "ground",
		Options:  append(voltOptions(), pixelfx.Option{Name: "seed", Default: pixelfx.Num(2)}),
	},
	New: newSparkArc,
}

SparkArc is a climbing arc between two rods: it strikes white at their narrow foot, climbs on rising heat as it stretches and bows, sputters and snaps at the top, then strikes again. It is registered as "lightning/spark-arc".

var StormCloud = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Storm cloud",
		Desc:     "A storm cloud boils overhead, billows lit from inside by flickering discharges, ragged scud under its flat dark base; rain slants down and once a loop a bolt cracks to the floor.",
		Tags:     []string{"lightning", "storm", "weather", "cloud", "rain", "ambient", "loop"},
		Size:     [2]int{168, 176},
		Origin:   [2]int{84, 164},
		Duration: 3,
		Loop:     true,
		FPS:      30,
		BG:       "ground",
		Options: append(voltOptions(),
			pixelfx.Option{Name: "cloud", Default: pixelfx.Palette("#09070f", "#120f1e", "#1b182e", "#252640", "#323758", "#464d78", "#646b9c")},
			pixelfx.Option{Name: "rain", Default: pixelfx.Palette("#2b3250", "#46527a", "#6d7cab", "#a5b5e0")},
			pixelfx.Option{Name: "seed", Default: pixelfx.Num(8)},
		),
	},
	New: newStormCloud,
}

StormCloud is a storm cloud boiling overhead, its billows lit from inside by flickering discharges, ragged scud under its flat dark base, slanting rain, and once a loop a bolt cracking to the floor. It is registered as "lightning/storm-cloud".

var TeslaCoil = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Tesla coil",
		Desc:     "A copper coil under a steel torus throws branching arcs that lash out in volleys and now and then strike the floor in a spray of sparks, lighting the metal and the ground.",
		Tags:     []string{"lightning", "electric", "tesla", "machine", "prop", "loop"},
		Size:     [2]int{224, 136},
		Origin:   [2]int{112, 120},
		Duration: 2.4,
		Loop:     true,
		FPS:      30,
		BG:       "ground",
		Options: append(voltOptions(),
			pixelfx.Option{Name: "copper", Default: pixelfx.Palette("#2a120c", "#5a2814", "#8e4a1e", "#c4772f", "#eaa65a", "#ffd9a0")},
			pixelfx.Option{Name: "steel", Default: pixelfx.Palette("#0f121c", "#1f2433", "#353d52", "#556078", "#7f8ba3", "#b8c3d6", "#f2f6ff")},
			pixelfx.Option{Name: "seed", Default: pixelfx.Num(4)},
		),
	},
	New: newTeslaCoil,
}

TeslaCoil is a copper coil under a steel torus throwing branching arcs that lash out in volleys and now and then strike the floor in a spray of sparks, lighting the metal and the ground. It is registered as "lightning/tesla-coil".

var Thunderclap = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Thunderclap",
		Desc:     "A thunderclap round the caster: a white flash, forked bolts burst out and stab the floor, a heavy shock ring tears across the ground raising dust and grit, sparks streak away.",
		Tags:     []string{"lightning", "electric", "nova", "aoe", "spell", "shockwave", "one-shot"},
		Size:     [2]int{288, 156},
		Origin:   [2]int{144, 124},
		Duration: 1.9,
		Loop:     false,
		FPS:      30,
		BG:       "ground",
		Actor:    2,
		Options: append(voltOptions(),
			pixelfx.Option{Name: "reach", Default: pixelfx.Num(104)},
			pixelfx.Option{Name: "seed", Default: pixelfx.Num(6)},
		),
	},
	Act: &pixelfx.Act{
		OnBody:  true,
		Follow:  pixelfx.Val(0),
		Targets: []float64{104},
		Poses: []pixelfx.Key{
			{T: -0.46, Pose: pixelfx.Ready},
			{T: -0.18, Pose: thWide},
			{T: 0.08, Pose: thWide.With(pixelfx.Crouch.Is(6))},
			{T: 0.12, Pose: thClap, How: "snap"},
			{T: 0.55, Pose: thClap.With(pixelfx.Y.Is(0), pixelfx.FFY.Is(-4), pixelfx.FBY.Is(-4), pixelfx.Crouch.Is(1))},
			{T: 1.05, Pose: pixelfx.Pose{}.With(pixelfx.Turn.Is(1), pixelfx.Crouch.Is(3), pixelfx.FX.Is(-10), pixelfx.FY.Is(-28), pixelfx.BX.Is(11), pixelfx.BY.Is(-28), pixelfx.FFX.Is(-4), pixelfx.FBX.Is(5))},
			{T: 1.7, Pose: pixelfx.Ready},
		},
		Hits: []pixelfx.Hit{
			{T: 0.12, Stop: 0.13, Shake: 0.3, Amp: pixelfx.Val(3), NoTarget: true},
			{T: 0.42, Push: pixelfx.Val(2), Straw: pixelfx.Val(14), Y: pixelfx.Val(-8), Skin: "shock", Shiver: 0.5},
			{T: 1.2, Push: pixelfx.Val(0), Straw: pixelfx.Val(0), Flash: pixelfx.Val(0), Skin: pixelfx.SkinNone},
		},
	},
	New: newThunderclap,
}

Thunderclap is a thunderclap round the caster: a white flash, forked bolts bursting out and stabbing the floor, a heavy shock ring tearing across the ground raising dust and grit, sparks streaking away. It is registered as "lightning/thunderclap".

var ZapHit = &pixelfx.Effect{
	Meta: pixelfx.Meta{
		Name:     "Zap hit",
		Desc:     "A contact zap: an arc snaps in from the left, the hit point overloads into a knot of tiny crackling zigzags, a fern of burn marks glows outward, sparks jink away, ozone puffs.",
		Tags:     []string{"lightning", "electric", "hit", "impact", "combat", "directional", "one-shot"},
		Size:     [2]int{144, 112},
		Origin:   [2]int{76, 56},
		Duration: 0.9,
		Loop:     false,
		FPS:      30,
		BG:       "dark",
		Options: []pixelfx.Option{
			{Name: "palette", Default: pixelfx.Palette(volt...)},
			{Name: "seed", Default: pixelfx.Num(3)},
		},
	},
	New: newZapHit,
}

ZapHit is a contact zap: an arc snaps in from the left, the hit point overloads into a knot of tiny crackling zigzags, a fern of burn marks glows outward, sparks jink away and ozone puffs. It is registered as "lightning/zap-hit".