-
-
Notifications
You must be signed in to change notification settings - Fork 4
Plants Schema #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Plants Schema #142
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
53d113a
First Sketch of Plants
Lector bc41256
Added Biome and Rarity for plants.
Lector d8680b8
Added Combat uses to HerbalAid.ts
Lector 5b32bc5
Replaced some Entities with simpler enums
Lector 54ba25e
Occurences in Plant.ts can now have translations
Lector ab87ca8
Prettier
Lector 61cdc96
Added EffectTypes to consumptions of Plant.ts
Lector 029d65f
Merge branch 'main' into feature/plants
Lector 83686a4
Corrected Feedback
Lector 7242f29
Merge branch 'feature/plants' of https://github.com/elyukai/optolith-…
Lector 444b2a2
Formatting and minor change
Lector 7d475e8
Prettier
Lector File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import * as DB from "tsondb/schema/dsl" | ||
| import { src } from "../../source/_PublicationRef.js" | ||
| import { NestedTranslationMap } from "../../Locale.js" | ||
| import { WeaponIdentifier, ArmorIdentifier } from "../../_Identifier.js" | ||
| import { EffectType } from "./_Herbary.js" | ||
|
|
||
| export const HerbalAid = DB.Entity(import.meta.url, { | ||
| name: "HerbalAid", | ||
| namePlural: "HerbalAids", | ||
| type: () => | ||
| DB.Object({ | ||
| types: DB.Required({ | ||
| comment: "The plant types this aid belongs to.", | ||
| type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), | ||
| }), | ||
| crafting_difficulty: DB.Required({ | ||
| comment: "The difficulty for this aid to craft.", | ||
| type: DB.Integer(), | ||
| }), | ||
| combatUse: DB.Optional({ | ||
| comment: "The armor or weapon this herbal aid represents.", | ||
| type: DB.IncludeIdentifier(HerbalAidCombatUse), | ||
| }), | ||
| src, | ||
| translations: NestedTranslationMap( | ||
| DB.Required, | ||
| "HerbalAid", | ||
| DB.Object({ | ||
| name: DB.Required({ | ||
| comment: "The herbal aid's name.", | ||
| type: DB.String({ minLength: 1 }), | ||
| }), | ||
| description: DB.Required({ | ||
| comment: "The herbal aid's description.", | ||
| type: DB.String({ minLength: 1, markdown: "block" }), | ||
| }), | ||
| ingredients: DB.Required({ | ||
| comment: "The ingredients used to craft this herbal aid.", | ||
| type: DB.Array(DB.String({ minLength: 1, markdown: "inline" }), { minItems: 1 }), | ||
| }), | ||
| typical_tools: DB.Optional({ | ||
| comment: "The typical tools used to craft this.", | ||
| type: DB.Array(DB.String({ minLength: 1, markdown: "inline" }), { minItems: 1 }), | ||
| }), | ||
| }), | ||
| ), | ||
| }), | ||
| instanceDisplayName: {}, | ||
| uniqueConstraints: [ | ||
| { | ||
| entityMapKeyPath: "translations", | ||
| keyPathInEntityMap: "name", | ||
| }, | ||
| ], | ||
| }) | ||
|
|
||
| const HerbalAidCombatUse = DB.Enum(import.meta.url, { | ||
| name: "HerbalAidCombatUse", | ||
| values: () => ({ | ||
| Weapon: DB.EnumCase({ type: WeaponIdentifier() }), | ||
| Armor: DB.EnumCase({ type: ArmorIdentifier() }), | ||
| }), | ||
| }) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.