Public
Edited
Feb 6, 2023
1 fork
Insert cell
Insert cell
Insert cell
defense = Dice.black
Insert cell
Insert cell
Insert cell
Insert cell
dl44 = new Weapon({
dice: [Dice.blue, Dice.yellow],
surges: [{ damage: 2 }, { accuracy: 2, damage: 1 }]
})
Insert cell
e11 = new Weapon({
dice: [Dice.blue, Dice.green],
surges: [{ damage: 2 }, { accuracy: 2 }]
})
Insert cell
handCannon = new Weapon({
base: { accuracy: 1 },
dice: [Dice.red, Dice.red]
})
Insert cell
serviceRifle = new Weapon({
surges: [{ accuracy: 2 }],
dice: [Dice.blue, Dice.green]
})
Insert cell
dc15s = new Weapon({
base: { accuracy: 2 },
dice: [ Dice.green, Dice.green ],
})
Insert cell
tacticalDisplay = ({ base: { surge: 1 } })
Insert cell
plasmaCell = ({ base: { pierce: 1 }, surges: [ { damage: 1 } ] })
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
vibroSword = new Weapon({
base: { accuracy: 2 },
surges: [{ damage: 2 }, { bleed: true }],
dice: [Dice.blue, Dice.green]
})
Insert cell
balancedHilt = ({ base: { surge: 1 } })
Insert cell
jarrod = Object.entries({
"Vibrosword": vibroSword,
"Vibrosword w/ Balanced Hilt": vibroSword.attach(balancedHilt),
})
Insert cell
lines(jarrod, Dice.black)
Insert cell
Insert cell
focused = ({
dice: [ Dice.green ]
})
Insert cell
Insert cell
import { Weapon, Dice, atLeast, simulate } from '@visnup/imperial-assault'
Insert cell
lines = (outcomes, defense) =>
Plot.plot({
marks: [
Plot.line(
outcomes
.flatMap(([label, weapon]) =>
atLeast(simulate(weapon, defense), label)
)
.filter((d) => d.accuracy < 8),
{
x: "damage",
y: "count",
stroke: "label",
fx: "accuracy",
sort: "damage",
marker: true
}
)
],
x: { ticks: 4 },
y: { zero: true, tickFormat: "%" },
color: { legend: true },
grid: true,
height: 200,
width: 900
})
Insert cell
html`<style>
img { width: 130px }
</style>`
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more