Skip to content

Commit

Permalink
feat: add library entries for close and ranged combattechniques, cant…
Browse files Browse the repository at this point in the history
…rips, spells, rituals, blessings, liturgical chants and ceremonies
  • Loading branch information
elyukai committed Oct 4, 2024
1 parent 6d0057b commit e49cc0d
Show file tree
Hide file tree
Showing 37 changed files with 2,981 additions and 36 deletions.
28 changes: 15 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"moment": "^2.30.1",
"mousetrap": "1.6.5",
"optolith-character-schema": "^0.0.3",
"optolith-database-schema": "^0.16.8",
"optolith-database-schema": "^0.17.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-markdown": "^9.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/database/contents
24 changes: 16 additions & 8 deletions src/main_window/inlineLibrary/InlineLibraryRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ import { assertExhaustive } from "../../shared/utils/typeSafety.ts"
import { DisplayableMainIdentifier } from "../slices/inlineWikiSlice.ts"
import "./InlineLibrary.scss"
import { InlineLibraryPlaceholder } from "./InlineLibraryPlaceholder.tsx"
import { InlineLibraryBlessing } from "./entities/InlineLibraryBlessing.tsx"
import { InlineLibraryCantrip } from "./entities/InlineLibraryCantrip.tsx"
import { InlineLibraryCeremony } from "./entities/InlineLibraryCeremony.tsx"
import { InlineLibraryCloseCombatTechnique } from "./entities/InlineLibraryCloseCombatTechnique.tsx"
import { InlineLibraryExperienceLevel } from "./entities/InlineLibraryExperienceLevel.tsx"
import { InlineLibraryFocusRule } from "./entities/InlineLibraryFocusRule.tsx"
import { InlineLibraryLiturgicalChant } from "./entities/InlineLibraryLiturgicalChant.tsx"
import { InlineLibraryOptionalRule } from "./entities/InlineLibraryOptionalRule.tsx"
import { InlineLibraryRangedCombatTechnique } from "./entities/InlineLibraryRangedCombatTechnique.tsx"
import { InlineLibraryRitual } from "./entities/InlineLibraryRitual.tsx"
import { InlineLibrarySkill } from "./entities/InlineLibrarySkill.tsx"
import { InlineLibrarySpell } from "./entities/InlineLibrarySpell.tsx"

type Props = {
id: DisplayableMainIdentifier
Expand Down Expand Up @@ -48,27 +56,27 @@ export const InlineLibraryRouter: FC<Props> = ({ id }) => {
case "BlessedTradition":
return <InlineLibraryPlaceholder />
case "Blessing":
return <InlineLibraryPlaceholder />
return <InlineLibraryBlessing id={id.blessing} />
case "Book":
return <InlineLibraryPlaceholder />
case "BowlEnchantment":
return <InlineLibraryPlaceholder />
case "BrawlingSpecialAbility":
return <InlineLibraryPlaceholder />
case "Cantrip":
return <InlineLibraryPlaceholder />
return <InlineLibraryCantrip id={id.cantrip} />
case "CauldronEnchantment":
return <InlineLibraryPlaceholder />
case "CeremonialItem":
return <InlineLibraryPlaceholder />
case "CeremonialItemSpecialAbility":
return <InlineLibraryPlaceholder />
case "Ceremony":
return <InlineLibraryPlaceholder />
return <InlineLibraryCeremony id={id.ceremony} />
case "ChronicleEnchantment":
return <InlineLibraryPlaceholder />
case "CloseCombatTechnique":
return <InlineLibraryPlaceholder />
return <InlineLibraryCloseCombatTechnique id={id.close_combat_technique} />
case "Clothes":
return <InlineLibraryPlaceholder />
case "CombatSpecialAbility":
Expand Down Expand Up @@ -134,7 +142,7 @@ export const InlineLibraryRouter: FC<Props> = ({ id }) => {
case "Liebesspielzeug":
return <InlineLibraryPlaceholder />
case "LiturgicalChant":
return <InlineLibraryPlaceholder />
return <InlineLibraryLiturgicalChant id={id.liturgical_chant} />
case "LiturgicalStyleSpecialAbility":
return <InlineLibraryPlaceholder />
case "LuxuryGood":
Expand Down Expand Up @@ -178,11 +186,11 @@ export const InlineLibraryRouter: FC<Props> = ({ id }) => {
case "Race":
return <InlineLibraryPlaceholder />
case "RangedCombatTechnique":
return <InlineLibraryPlaceholder />
return <InlineLibraryRangedCombatTechnique id={id.ranged_combat_technique} />
case "RingEnchantment":
return <InlineLibraryPlaceholder />
case "Ritual":
return <InlineLibraryPlaceholder />
return <InlineLibraryRitual id={id.ritual} />
case "RopeOrChain":
return <InlineLibraryPlaceholder />
case "Sermon":
Expand All @@ -198,7 +206,7 @@ export const InlineLibraryRouter: FC<Props> = ({ id }) => {
case "SkillStyleSpecialAbility":
return <InlineLibraryPlaceholder />
case "Spell":
return <InlineLibraryPlaceholder />
return <InlineLibrarySpell id={id.spell} />
case "SpellSwordEnchantment":
return <InlineLibraryPlaceholder />
case "StaffEnchantment":
Expand Down
25 changes: 25 additions & 0 deletions src/main_window/inlineLibrary/entities/InlineLibraryBlessing.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { FC } from "react"
import { LibraryEntry } from "../../../shared/components/libraryEntry/LibraryEntry.tsx"
import { getBlessingLibraryEntry } from "../../../shared/domain/rated/liturgicalChant.ts"
import { useAppSelector } from "../../hooks/redux.ts"
import { SelectGetById } from "../../selectors/basicCapabilitySelectors.ts"

type Props = {
id: number
}

/**
* Displays all information about a blessing.
*/
export const InlineLibraryBlessing: FC<Props> = ({ id }) => {
const getTargetCategoryById = useAppSelector(SelectGetById.Static.TargetCategory)
const entry = useAppSelector(SelectGetById.Static.Blessing)(id)

return (
<LibraryEntry
createLibraryEntry={getBlessingLibraryEntry(entry, {
getTargetCategoryById,
})}
/>
)
}
31 changes: 31 additions & 0 deletions src/main_window/inlineLibrary/entities/InlineLibraryCantrip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { FC } from "react"
import { LibraryEntry } from "../../../shared/components/libraryEntry/LibraryEntry.tsx"
import { getCantripLibraryEntry } from "../../../shared/domain/rated/spell.ts"
import { useAppSelector } from "../../hooks/redux.ts"
import { SelectGetById } from "../../selectors/basicCapabilitySelectors.ts"

type Props = {
id: number
}

/**
* Displays all information about a cantrip.
*/
export const InlineLibraryCantrip: FC<Props> = ({ id }) => {
const getCurriculumById = useAppSelector(SelectGetById.Static.Curriculum)
const getTargetCategoryById = useAppSelector(SelectGetById.Static.TargetCategory)
const getPropertyById = useAppSelector(SelectGetById.Static.Property)
const getMagicalTraditionById = useAppSelector(SelectGetById.Static.MagicalTradition)
const entry = useAppSelector(SelectGetById.Static.Cantrip)(id)

return (
<LibraryEntry
createLibraryEntry={getCantripLibraryEntry(entry, {
getTargetCategoryById,
getPropertyById,
getMagicalTraditionById,
getCurriculumById,
})}
/>
)
}
35 changes: 35 additions & 0 deletions src/main_window/inlineLibrary/entities/InlineLibraryCeremony.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { FC } from "react"
import { LibraryEntry } from "../../../shared/components/libraryEntry/LibraryEntry.tsx"
import { getCeremonyLibraryEntry } from "../../../shared/domain/rated/liturgicalChant.ts"
import { useAppSelector } from "../../hooks/redux.ts"
import { SelectGetById } from "../../selectors/basicCapabilitySelectors.ts"

type Props = {
id: number
}

/**
* Displays all information about a ceremony.
*/
export const InlineLibraryCeremony: FC<Props> = ({ id }) => {
const getAttributeById = useAppSelector(SelectGetById.Static.Attribute)
const getDerivedCharacteristicById = useAppSelector(SelectGetById.Static.DerivedCharacteristic)
const getSkillModificationLevelById = useAppSelector(SelectGetById.Static.SkillModificationLevel)
const getTargetCategoryById = useAppSelector(SelectGetById.Static.TargetCategory)
const getBlessedTraditionById = useAppSelector(SelectGetById.Static.BlessedTradition)
const getAspectById = useAppSelector(SelectGetById.Static.Aspect)
const entry = useAppSelector(SelectGetById.Static.Ceremony)(id)

return (
<LibraryEntry
createLibraryEntry={getCeremonyLibraryEntry(entry, {
getAttributeById,
getDerivedCharacteristicById,
getSkillModificationLevelById,
getTargetCategoryById,
getBlessedTraditionById,
getAspectById,
})}
/>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { FC } from "react"
import { LibraryEntry } from "../../../shared/components/libraryEntry/LibraryEntry.tsx"
import { getCloseCombatTechniqueLibraryEntry } from "../../../shared/domain/rated/combatTechnique.ts"
import { useAppSelector } from "../../hooks/redux.ts"
import { SelectGetById } from "../../selectors/basicCapabilitySelectors.ts"

type Props = {
id: number
}

/**
* Displays all information about a close combat technique.
*/
export const InlineLibraryCloseCombatTechnique: FC<Props> = ({ id }) => {
const getAttributeById = useAppSelector(SelectGetById.Static.Attribute)
const entry = useAppSelector(SelectGetById.Static.CloseCombatTechnique)(id)

return (
<LibraryEntry
createLibraryEntry={getCloseCombatTechniqueLibraryEntry(entry, {
getAttributeById,
})}
/>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { FC } from "react"
import { LibraryEntry } from "../../../shared/components/libraryEntry/LibraryEntry.tsx"
import { getLiturgicalChantLibraryEntry } from "../../../shared/domain/rated/liturgicalChant.ts"
import { useAppSelector } from "../../hooks/redux.ts"
import { SelectGetById } from "../../selectors/basicCapabilitySelectors.ts"

type Props = {
id: number
}

/**
* Displays all information about a liturgical chant.
*/
export const InlineLibraryLiturgicalChant: FC<Props> = ({ id }) => {
const getAttributeById = useAppSelector(SelectGetById.Static.Attribute)
const getDerivedCharacteristicById = useAppSelector(SelectGetById.Static.DerivedCharacteristic)
const getSkillModificationLevelById = useAppSelector(SelectGetById.Static.SkillModificationLevel)
const getTargetCategoryById = useAppSelector(SelectGetById.Static.TargetCategory)
const getBlessedTraditionById = useAppSelector(SelectGetById.Static.BlessedTradition)
const getAspectById = useAppSelector(SelectGetById.Static.Aspect)
const entry = useAppSelector(SelectGetById.Static.LiturgicalChant)(id)

return (
<LibraryEntry
createLibraryEntry={getLiturgicalChantLibraryEntry(entry, {
getAttributeById,
getDerivedCharacteristicById,
getSkillModificationLevelById,
getTargetCategoryById,
getBlessedTraditionById,
getAspectById,
})}
/>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { FC } from "react"
import { LibraryEntry } from "../../../shared/components/libraryEntry/LibraryEntry.tsx"
import { getRangedCombatTechniqueLibraryEntry } from "../../../shared/domain/rated/combatTechnique.ts"
import { useAppSelector } from "../../hooks/redux.ts"
import { SelectGetById } from "../../selectors/basicCapabilitySelectors.ts"

type Props = {
id: number
}

/**
* Displays all information about a ranged combat technique.
*/
export const InlineLibraryRangedCombatTechnique: FC<Props> = ({ id }) => {
const getAttributeById = useAppSelector(SelectGetById.Static.Attribute)
const entry = useAppSelector(SelectGetById.Static.RangedCombatTechnique)(id)

return (
<LibraryEntry
createLibraryEntry={getRangedCombatTechniqueLibraryEntry(entry, {
getAttributeById,
})}
/>
)
}
35 changes: 35 additions & 0 deletions src/main_window/inlineLibrary/entities/InlineLibraryRitual.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { FC } from "react"
import { LibraryEntry } from "../../../shared/components/libraryEntry/LibraryEntry.tsx"
import { getRitualLibraryEntry } from "../../../shared/domain/rated/spell.ts"
import { useAppSelector } from "../../hooks/redux.ts"
import { SelectGetById } from "../../selectors/basicCapabilitySelectors.ts"

type Props = {
id: number
}

/**
* Displays all information about a ritual.
*/
export const InlineLibraryRitual: FC<Props> = ({ id }) => {
const getAttributeById = useAppSelector(SelectGetById.Static.Attribute)
const getDerivedCharacteristicById = useAppSelector(SelectGetById.Static.DerivedCharacteristic)
const getSkillModificationLevelById = useAppSelector(SelectGetById.Static.SkillModificationLevel)
const getTargetCategoryById = useAppSelector(SelectGetById.Static.TargetCategory)
const getPropertyById = useAppSelector(SelectGetById.Static.Property)
const getMagicalTraditionById = useAppSelector(SelectGetById.Static.MagicalTradition)
const entry = useAppSelector(SelectGetById.Static.Ritual)(id)

return (
<LibraryEntry
createLibraryEntry={getRitualLibraryEntry(entry, {
getAttributeById,
getDerivedCharacteristicById,
getSkillModificationLevelById,
getTargetCategoryById,
getPropertyById,
getMagicalTraditionById,
})}
/>
)
}
Loading

0 comments on commit e49cc0d

Please sign in to comment.