Skip to content

Commit

Permalink
add entities for sundered isles
Browse files Browse the repository at this point in the history
Fixes: #373
  • Loading branch information
zkat committed Jul 7, 2024
1 parent f93a54b commit b43da16
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 54 deletions.
77 changes: 77 additions & 0 deletions data/sundered-isles.supplement.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"type": "expansion",
"_id": "sundered_isles_supp",
"title": "Sundered Isles Iron Vault Support",
"datasworn_version": "0.1.0",
"ruleset": "sundered_isles",
"oracles": {
"templates": {
"_id": "oracle_collection:sundered_isles_supp/templates",
"name": "Templates",
"type": "oracle_collection",
"oracle_type": "tables",
"_source": {
"title": "Iron Vault Support Oracles for Sundered Isles",
"authors": [
{
"name": "Iron Vault Dev Team"
}
],
"date": "2024-06-15",
"url": "https://github.com/iron-vault-plugin/iron-vault",
"license": "MIT"
},
"collections": {},
"contents": {
"region": {
"_id": "oracle_rollable:sundered_isles_supp/core/region",
"name": "Region",
"dice": "1d100",
"type": "oracle_rollable",
"oracle_type": "table_text",
"_source": {
"title": "Iron Vault Support Oracles for Sundered Isles",
"authors": [
{
"name": "Iron Vault Dev Team"
}
],
"date": "2024-06-15",
"url": "https://github.com/iron-vault-plugin/iron-vault",
"license": "MIT"
},
"column_labels": {
"roll": "Roll",
"text": "Region"
},
"rows": [
{
"_id": "oracle_rollable.row:sundered_isles_supp/core/region.0",
"roll": {
"min": 1,
"max": 45
},
"text": "Myriads"
},
{
"_id": "oracle_rollable.row:sundered_isles_supp/core/region.1",
"roll": {
"min": 46,
"max": 80
},
"text": "Margins"
},
{
"_id": "oracle_rollable.row:sundered_isles_supp/core/region.2",
"roll": {
"min": 81,
"max": 100
},
"text": "Reaches"
}
]
}
}
}
}
}
53 changes: 53 additions & 0 deletions data/sundered-isles.supplement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
type: expansion
_id: sundered_isles_supp
title: "Sundered Isles Iron Vault Support"
datasworn_version: 0.1.0
ruleset: sundered_isles
oracles:
templates:
_id: oracle_collection:sundered_isles_supp/templates
name: Templates
type: oracle_collection
oracle_type: tables
_source:
title: Iron Vault Support Oracles for Sundered Isles
authors:
- name: Iron Vault Dev Team
date: "2024-06-15"
url: "https://github.com/iron-vault-plugin/iron-vault"
license: "MIT"
collections: {}
contents:
"region":
_id: oracle_rollable:sundered_isles_supp/core/region
name: Region
dice: "1d100"
type: oracle_rollable
oracle_type: table_text
_source:
title: Iron Vault Support Oracles for Sundered Isles
authors:
- name: Iron Vault Dev Team
date: "2024-06-15"
url: "https://github.com/iron-vault-plugin/iron-vault"
license: "MIT"
column_labels:
roll: Roll
text: Region
rows:
- _id: oracle_rollable.row:sundered_isles_supp/core/region.0
roll:
min: 1
max: 45
text: "Myriads"
- _id: oracle_rollable.row:sundered_isles_supp/core/region.1
roll:
min: 46
max: 80
text: "Margins"
- _id: oracle_rollable.row:sundered_isles_supp/core/region.2
roll:
min: 81
max: 100
text: "Reaches"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "jest",
"build": "tsc --noEmit && node esbuild.config.js production",
"dev:build": "tsc --noEmit && node esbuild.config.js nowatch",
"compile-data": "yq -ojson data/starforged.supplement.yaml > data/starforged.supplement.json",
"compile-data": "yq -ojson data/starforged.supplement.yaml > data/starforged.supplement.json && yq -ojson data/sundered-isles.supplement.yaml > data/sundered-isles.supplement.json",
"dev": "node esbuild.config.js",
"bump": "node ./scripts/update_manifest.js ${npm_config_tag:?} && npm version --no-git-tag-version ${npm_config_tag} && git commit -a -m \"bumping manifest version to ${npm_config_tag}\" && git tag -a ${npm_config_tag} -m ${npm_config_tag} && git push --follow-tags",
"latestrev": "git tag -l --sort -creatordate '[0-9]*' | head -n 1",
Expand Down
2 changes: 2 additions & 0 deletions src/datastore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { Component, Notice, TFile, TFolder, type App } from "obsidian";
import { OracleRoller } from "oracles/roller";
import { Ruleset } from "rules/ruleset";
import starforgedSupp from "../data/starforged.supplement.json" assert { type: "json" };
import sunderedSupp from "../data/sundered-isles.supplement.json" assert { type: "json" };
import { PLUGIN_DATASWORN_VERSION } from "./constants";

const logger = rootLogger.getLogger("datastore");
Expand Down Expand Up @@ -91,6 +92,7 @@ export class Datastore extends Component implements IDataContext {

if (this.plugin.settings.enableSunderedIsles) {
this.indexBuiltInData(sunderedIslesPackage as Datasworn.Expansion);
this.indexBuiltInData(sunderedSupp as Datasworn.Expansion, 5);
}

if (this.plugin.settings.useHomebrew) {
Expand Down
100 changes: 47 additions & 53 deletions src/entity/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,59 +183,6 @@ export const ENTITIES: Record<string, EntityDescriptor<EntitySpec>> = {
},
},
},

sfSettlement: {
label: "Settlement",
nameGen: (ent) => ent.name[0]?.simpleResult,
collectionId: "oracle_collection:starforged/settlement",
spec: {
region: {
id: "oracle_rollable:starforgedsupp/core/region",
firstLook: true,
definesAttribute: {
order: 1,
mechanism: AttributeMechanism.Snakecase,
},
},
name: {
id: "oracle_rollable:starforged/settlement/name",
firstLook: true,
},
location: {
id: "oracle_rollable:starforged/settlement/location",
firstLook: true,
},
population: {
id: "oracle_rollable:starforged/settlement/population/{{region}}",
firstLook: true,
name: "Population",
},
authority: {
id: "oracle_rollable:starforged/settlement/authority",
firstLook: true,
},
project: {
id: "oracle_rollable:starforged/settlement/projects",
firstLook: true,
},
firstLook: {
id: "oracle_rollable:starforged/settlement/first_look",
// lol this is ironic, but that's what the rulebook says
firstLook: false,
name: "First look",
},
initialContact: {
id: "oracle_rollable:starforged/settlement/initial_contact",
firstLook: false,
name: "Initial contact",
},
trouble: {
id: "oracle_rollable:starforged/settlement/trouble",
firstLook: false,
},
},
},

sfPlanet: {
label: "Planet",
nameGen: (ent) => ent.name[0]?.simpleResult,
Expand Down Expand Up @@ -309,4 +256,51 @@ export const ENTITIES: Record<string, EntityDescriptor<EntitySpec>> = {
},
},
},
siIsland: {
label: "Island",
nameGen: (ent) => ent.name[0]?.simpleResult,
collectionId: "oracle_collection:sundered_isles/island",
spec: {
region: {
id: "oracle_rollable:sundered_isles_supp/core/region",
firstLook: true,
definesAttribute: {
order: 1,
mechanism: AttributeMechanism.Snakecase,
},
},
name: {
id: "oracle_rollable:sundered_isles/island/name",
firstLook: true,
},
size: {
id: "oracle_rollable:sundered_isles/island/landscape/size",
firstLook: true,
},
terrain: {
id: "oracle_rollable:sundered_isles/island/landscape/terrain",
firstLook: true,
},
vitality: {
id: "oracle_rollable:sundered_isles/island/landscape/vitality/{{region}}",
firstLook: true,
name: "Vitality",
},
nearby_islands: {
id: "oracle_rollable:sundered_isles/island/nearby_islands/{{region}}",
firstLook: true,
name: "Nearby islands",
},
coastline_aspects: {
id: "oracle_rollable:sundered_isles/island/coastline_aspects",
},
offshore_observations: {
id: "oracle_rollable:sundered_isles/island/offshore_observations",
},
visible_habitation: {
id: "oracle_rollable:sundered_isles/island/visible_habitation/{{region}}",
name: "Visible habitation",
},
},
},
};

0 comments on commit b43da16

Please sign in to comment.