-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbd1bf8
commit 7d72bb2
Showing
18 changed files
with
548 additions
and
164 deletions.
There are no files selected for viewing
This file contains 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 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 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,13 @@ | ||
<script lang="ts"> | ||
</script> | ||
|
||
<div class="creator-container"> | ||
<div class="creator" /> | ||
</div> | ||
|
||
<style> | ||
.creator { | ||
max-width: 50vw; | ||
max-height: 50vh; | ||
} | ||
</style> |
This file contains 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 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 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,29 @@ | ||
<script lang="ts"> | ||
import type { Monster } from "@types"; | ||
import type StatBlockPlugin from "src/main"; | ||
import { setContext } from "svelte"; | ||
import Bar from "./ui/Bar.svelte"; | ||
import Content from "./ui/Content.svelte"; | ||
export let monster: Monster; | ||
export let plugin: StatBlockPlugin; | ||
setContext<StatBlockPlugin>("plugin", plugin); | ||
</script> | ||
|
||
<div class="obsidian-statblock-plugin statblock"> | ||
{#if monster} | ||
<Bar /> | ||
<Content {monster} /> | ||
<Bar /> | ||
{:else} | ||
<span>Invalid monster.</span> | ||
{/if} | ||
</div> | ||
|
||
<style> | ||
.statblock { | ||
max-width: 404px; | ||
} | ||
</style> |
This file contains 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 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,11 @@ | ||
<div class="bar" /> | ||
|
||
<style> | ||
.bar { | ||
height: 5px; | ||
background: var(--statblock-bar-color); | ||
border: 1px solid #000; | ||
z-index: 1; | ||
width: auto; | ||
} | ||
</style> |
This file contains 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,69 @@ | ||
<script lang="ts"> | ||
import type { Monster } from "@types"; | ||
import { AbilityAliases } from "src/data/constants"; | ||
import { toTitleCase } from "src/util/util"; | ||
import PropertyLine from "./PropertyLine.svelte"; | ||
export let monster: Monster; | ||
function getMod(value: number) { | ||
return `${value > 0 ? "+" : ""}${value}`; | ||
} | ||
const saves = monster.saves | ||
.map((ability) => { | ||
if (typeof ability != "object" || ability == null) return null; | ||
let key = Object.keys(ability)[0]; | ||
if (!key) return null; | ||
if (!AbilityAliases[key.toLowerCase()]) return null; | ||
const value = Object.values(ability)[0]; | ||
return `${AbilityAliases[key.toLowerCase()]} ${getMod(value)}`; | ||
}) | ||
.filter((m) => m); | ||
const skillsaves = monster.skillsaves | ||
.map((ability) => { | ||
if (typeof ability != "object" || ability == null) return null; | ||
let key = Object.keys(ability)[0]; | ||
if (!key) return null; | ||
const value = Object.values(ability)[0]; | ||
return `${toTitleCase(key)} ${getMod(value)}`; | ||
}) | ||
.filter((m) => m); | ||
</script> | ||
|
||
<div class="info"> | ||
{#if saves && saves.length} | ||
<PropertyLine property={"Saving Throws"} text={saves.join(", ")} /> | ||
{/if} | ||
{#if skillsaves && skillsaves.length} | ||
<PropertyLine property={"Skills"} text={skillsaves.join(", ")} /> | ||
{/if} | ||
{#if monster.damage_immunities && monster.damage_immunities.length} | ||
<PropertyLine | ||
property={"Damage Immunities"} | ||
text={monster.damage_immunities} | ||
/> | ||
{/if} | ||
{#if monster.condition_immunities && monster.condition_immunities.length} | ||
<PropertyLine | ||
property={"Condition Immunities"} | ||
text={monster.condition_immunities} | ||
/> | ||
{/if} | ||
{#if monster.damage_resistances && monster.damage_resistances.length} | ||
<PropertyLine | ||
property={"Resistances"} | ||
text={monster.damage_resistances} | ||
/> | ||
{/if} | ||
{#if monster.damage_vulnerabilities && monster.damage_vulnerabilities.length} | ||
<PropertyLine | ||
property={"Damage Vulnerabilities"} | ||
text={monster.damage_vulnerabilities} | ||
/> | ||
{/if} | ||
{#if monster.senses && monster.senses.length} | ||
<PropertyLine property={"Senses"} text={monster.senses} /> | ||
{/if} | ||
<PropertyLine property={"Languages"} text={monster.languages ?? "-"} /> | ||
</div> |
Oops, something went wrong.