Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
charredUtensil committed Aug 13, 2024
1 parent 546940f commit 7b5a212
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 235 deletions.
2 changes: 1 addition & 1 deletion src/core/architects/established_hq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,4 @@ export const ESTABLISHED_HQ = [
},
] as const satisfies readonly Architect<HqMetadata>[];

export default ESTABLISHED_HQ;
export default ESTABLISHED_HQ;
3 changes: 2 additions & 1 deletion src/core/architects/lost_miners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ const BASE: PartialArchitect<LostMinersMetadata> = {
const message = cavern.lore.foundAllLostMiners(cavern.dice).text;
return scriptFragment(
`# Globals: Lost Miners`,
lostMinerCaves > 1 && `int ${gLostMiners.remainingCaves}=${lostMinerCaves}`,
lostMinerCaves > 1 &&
`int ${gLostMiners.remainingCaves}=${lostMinerCaves}`,
`int ${gLostMiners.done}=0`,
`string ${gLostMiners.messageFoundAll}="${escapeString(message)}"`,
eventChain(
Expand Down
2 changes: 2 additions & 0 deletions src/core/architects/utils/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ export function eventChain(name: string, ...rest: (`${string};` | Falsy)[]) {
export function escapeString(s: string) {
return s.replace(/\\/g, "").replace(/"/g, '\\"');
}

export class ScriptBuilder {}
6 changes: 3 additions & 3 deletions src/core/lore/graphs/completeness.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const EXPECTED = phraseGraph<State>(({ pg, state, start, end, cut, skip }) => {
.then(skip, state("spawnHasErosion"))
.then(skip, state("treasureCaveOne", "treasureCaveMany"))
.then(
skip,
skip,
state("spawnIsNomadOne", "spawnIsNomadsTogether"),
state("spawnIsHq").then(hasHq).then(cut),
)
Expand All @@ -62,13 +62,13 @@ const EXPECTED = phraseGraph<State>(({ pg, state, start, end, cut, skip }) => {
state("resourceObjective"),
),
)
.then(state('rockBiome', 'iceBiome', 'lavaBiome'))
.then(state("rockBiome", "iceBiome", "lavaBiome"))
.then(end);
});

test(`Name is complete`, () => {
expectCompletion(NAME, EXPECTED);
})
});

test(`Premise is complete`, () => {
expectCompletion(PREMISE, EXPECTED);
Expand Down
283 changes: 67 additions & 216 deletions src/core/lore/graphs/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,264 +3,115 @@ import { State } from "../lore";

export const NAME = phraseGraph<State>(
({ pg, state, start, end, cut, skip }) => {
function f({rock, ice, lava, mid, last}: {rock: string[], ice?: string[], lava?: string[], mid?: string[], last: string[]}) {
function f({
rock,
ice,
lava,
mid,
last,
}: {
rock: string[];
ice?: string[];
lava?: string[];
mid?: string[];
last: string[];
}) {
start
.then(
state('rockBiome').then(...rock),
ice ? state('iceBiome').then(...ice) : cut,
lava ? state('lavaBiome').then(...lava) : cut,
state("rockBiome").then(...rock),
ice ? state("iceBiome").then(...ice) : cut,
lava ? state("lavaBiome").then(...lava) : cut,
)
.then(skip, ...(mid || []))
.then(...last)
.then(end);
}

f({
rock: [
'Andesite',
'Anthracite',
'Argillite',
],
ice: [
'Arctic',
'Avalanche',
],
lava: [
'Asbestos',
'Ashen',
],
last: [
'Abyss',
'Action',
'Alley',
'Attack',
],
rock: ["Andesite", "Anthracite", "Argillite"],
ice: ["Arctic", "Avalanche"],
lava: ["Asbestos", "Ashen"],
last: ["Abyss", "Action", "Alley", "Attack"],
});

f({
rock: [
'Basalt',
'Basanite',
'Bauxite',
'Boulder',
'Breccia',
'Bullion',
],
ice: [
'Blizzard',
],
last: [
'Balance',
'Blitz',
'Breach',
'Break',
'Bonanza',
'Burrow',
],
rock: ["Basalt", "Basanite", "Bauxite", "Boulder", "Breccia", "Bullion"],
ice: ["Blizzard"],
last: ["Balance", "Blitz", "Breach", "Break", "Bonanza", "Burrow"],
});

f({
rock: [
'Chalk',
'Claystone',
'Core',
'Crystal',
],
lava: [
'Caldera',
'Cinder',
],
last: [
'Calamity',
'Caper',
'Cavern',
'Chaos',
'Conflict',
'Conundrum',
],
rock: ["Chalk", "Claystone", "Core", "Crystal"],
lava: ["Caldera", "Cinder"],
last: ["Calamity", "Caper", "Cavern", "Chaos", "Conflict", "Conundrum"],
});

f({
rock: [
'Diamond',
'Diorite',
'Dolomite',
'Dunite',
],
ice: [
'Drift',
],
last: [
'Depths',
'Dash',
'Descent',
'Despair',
'Drive',
],
rock: ["Diamond", "Diorite", "Dolomite", "Dunite"],
ice: ["Drift"],
last: ["Depths", "Dash", "Descent", "Despair", "Drive"],
});

f({
rock: [
'Emerald',
'Evaporite',
],
lava: [
'Ember',
],
last: [
'Enigma',
'Eruption',
'Excavation',
'Express',
],
rock: ["Emerald", "Evaporite"],
lava: ["Ember"],
last: ["Enigma", "Eruption", "Excavation", "Express"],
});

f({
rock: [
'Fault Line',
'Fissure',
'Flint',
],
ice: [
'Frostbite',
'Frosty',
],
last: [
'Folly',
'Frenzy',
'Fury',
],
rock: ["Fault Line", "Fissure", "Flint"],
ice: ["Frostbite", "Frosty"],
last: ["Folly", "Frenzy", "Fury"],
});

f({
rock: [
'Gneiss',
'Granite',
'Gritstone',
'Gypsum',
],
ice: [
'Glacier',
],
last: [
'Gauntlet',
'Getaway',
],
rock: ["Gneiss", "Granite", "Gritstone", "Gypsum"],
ice: ["Glacier"],
last: ["Gauntlet", "Getaway"],
});

f({
rock: [
'Lapis Lazuli',
'Laterite',
'Lignite',
'Limestone',
],
lava: [
'Lava',
'Lava Lake',
],
last: [
'Labyrinth',
'Lair',
'Lure',
],
rock: ["Lapis Lazuli", "Laterite", "Lignite", "Limestone"],
lava: ["Lava", "Lava Lake"],
last: ["Labyrinth", "Lair", "Lure"],
});

f({
rock: [
'Marble',
'Metamorphic',
'Mineral',
'Mudstone',
],
ice: [
'Mammoth',
],
lava: [
'Magma',
'Mantle',
'Molten',
],
mid: [
'Mine',
'Moon',
],
last: [
'Mayhem',
'Maze',
'Meltdown',
'Menace',
'Mishap',
],
rock: ["Marble", "Metamorphic", "Mineral", "Mudstone"],
ice: ["Mammoth"],
lava: ["Magma", "Mantle", "Molten"],
mid: ["Mine", "Moon"],
last: ["Mayhem", "Maze", "Meltdown", "Menace", "Mishap"],
});

f({
rock: [
'Phosphorite',
'Pumice',
],
ice: [
'Permafrost',
'Polar',
],
lava: [
'Pyroclastic',
'Pyrolite',
],
last: [
'Passage',
'Peril',
'Pit',
'Plunge',
'Puzzle',
],
rock: ["Phosphorite", "Pumice"],
ice: ["Permafrost", "Polar"],
lava: ["Pyroclastic", "Pyrolite"],
last: ["Passage", "Peril", "Pit", "Plunge", "Puzzle"],
});

f({
rock: [
'Sandstone',
'Schist',
'Sedimentary',
'Shale',
'Silica',
'Silt',
'Slate',
'Stalactite',
],
ice: [
'Snowdrift',
'Subzero',
],
mid: [
'Shaft',
],
last: [
'Scramble',
'Shock',
'Showdown',
'Slide',
],
"Sandstone",
"Schist",
"Sedimentary",
"Shale",
"Silica",
"Silt",
"Slate",
"Stalactite",
],
ice: ["Snowdrift", "Subzero"],
mid: ["Shaft"],
last: ["Scramble", "Shock", "Showdown", "Slide"],
});

f({
rock: [
'Tuff',
'Turbidite',
'Twilight',
],
ice: [
'Taiga',
'Titanic',
'Tundra',
],
mid: [
'Tunnel',
],
last: [
'Tempest',
'Terror',
'Trouble',
],
rock: ["Tuff", "Turbidite", "Twilight"],
ice: ["Taiga", "Titanic", "Tundra"],
mid: ["Tunnel"],
last: ["Tempest", "Terror", "Trouble"],
});
},
);
);
6 changes: 3 additions & 3 deletions src/core/lore/lore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ export class Lore {
spawnIsNomadsTogether: nomads > 1,
treasureCaveOne: treasures === 1,
treasureCaveMany: treasures > 1,
rockBiome: cavern.context.biome === 'rock',
iceBiome: cavern.context.biome === 'ice',
lavaBiome: cavern.context.biome === 'lava',
rockBiome: cavern.context.biome === "rock",
iceBiome: cavern.context.biome === "ice",
lavaBiome: cavern.context.biome === "lava",
};

const enemies = filterTruthy([
Expand Down
Loading

0 comments on commit 7b5a212

Please sign in to comment.