Refactor DSA types and components for better structure and type consistency.
This commit is contained in:
0
src/assets/combattechniques.json
Normal file
0
src/assets/combattechniques.json
Normal file
154
src/assets/improvementcosttable.json
Normal file
154
src/assets/improvementcosttable.json
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
{
|
||||||
|
"steigerungsfaktoren": [
|
||||||
|
{
|
||||||
|
"aktivierung": "0",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 1,
|
||||||
|
"B": 2,
|
||||||
|
"C": 3,
|
||||||
|
"D": 4,
|
||||||
|
"E": null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "1-12",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 1,
|
||||||
|
"B": 2,
|
||||||
|
"C": 3,
|
||||||
|
"D": 4,
|
||||||
|
"E": 15
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "13",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 2,
|
||||||
|
"B": 4,
|
||||||
|
"C": 6,
|
||||||
|
"D": 8,
|
||||||
|
"E": 15
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "14",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 3,
|
||||||
|
"B": 6,
|
||||||
|
"C": 9,
|
||||||
|
"D": 12,
|
||||||
|
"E": 15
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "15",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 4,
|
||||||
|
"B": 8,
|
||||||
|
"C": 12,
|
||||||
|
"D": 16,
|
||||||
|
"E": 30
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "16",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 5,
|
||||||
|
"B": 10,
|
||||||
|
"C": 15,
|
||||||
|
"D": 20,
|
||||||
|
"E": 45
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "17",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 6,
|
||||||
|
"B": 12,
|
||||||
|
"C": 18,
|
||||||
|
"D": 24,
|
||||||
|
"E": 60
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "18",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 7,
|
||||||
|
"B": 14,
|
||||||
|
"C": 21,
|
||||||
|
"D": 28,
|
||||||
|
"E": 75
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "19",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 8,
|
||||||
|
"B": 16,
|
||||||
|
"C": 24,
|
||||||
|
"D": 32,
|
||||||
|
"E": 90
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "20",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 9,
|
||||||
|
"B": 18,
|
||||||
|
"C": 27,
|
||||||
|
"D": 36,
|
||||||
|
"E": 105
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "21",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 10,
|
||||||
|
"B": 20,
|
||||||
|
"C": 30,
|
||||||
|
"D": 40,
|
||||||
|
"E": 120
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "22",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 11,
|
||||||
|
"B": 22,
|
||||||
|
"C": 33,
|
||||||
|
"D": 44,
|
||||||
|
"E": 135
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "23",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 12,
|
||||||
|
"B": 24,
|
||||||
|
"C": 36,
|
||||||
|
"D": 48,
|
||||||
|
"E": 150
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "24",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 13,
|
||||||
|
"B": 26,
|
||||||
|
"C": 39,
|
||||||
|
"D": 52,
|
||||||
|
"E": 165
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"aktivierung": "25",
|
||||||
|
"faktoren": {
|
||||||
|
"A": 14,
|
||||||
|
"B": 28,
|
||||||
|
"C": 42,
|
||||||
|
"D": 56,
|
||||||
|
"E": 180
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
0
src/assets/skills.json
Normal file
0
src/assets/skills.json
Normal file
5
src/classes/Base.ts
Normal file
5
src/classes/Base.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export default class Base {
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
88
src/classes/CharacterSheet.ts
Normal file
88
src/classes/CharacterSheet.ts
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
import type {DSAAttributes, DSAExperienceLevel, DSAPersonalData, DSAStats} from "../types/baseCharacter.ts";
|
||||||
|
import type {DSACalculatedValue, DSAImprovements} from "../types/baseDSA.ts";
|
||||||
|
import type {DSABaseEquiment} from "../types/baseEquiment.ts";
|
||||||
|
import type {DSAArmor, DSAMeleeWeapon, DSARangedWeapon, DSAShieldParryWeapon} from "../types/equiment.ts";
|
||||||
|
import type {DSASpell} from "../types/character.ts";
|
||||||
|
import Skill from "./Skill.ts";
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// === LOGIC ===
|
||||||
|
// Skillpoint <-> QualityLevel
|
||||||
|
|
||||||
|
export default class CharacterSheet extends Skill {
|
||||||
|
public id: string
|
||||||
|
|
||||||
|
personalData: DSAPersonalData
|
||||||
|
attributes: DSAAttributes
|
||||||
|
stats: DSAStats
|
||||||
|
fatePoints: DSACalculatedValue;
|
||||||
|
experienceLevel: DSAExperienceLevel
|
||||||
|
advantanges: string[] // TODO
|
||||||
|
disadvantanges: string[] // TODO
|
||||||
|
generalSpecialAbilities: string[] // TODO
|
||||||
|
|
||||||
|
skills: string[] // TODO: {physical, social, nature, knowledge, craft} generated by GPT
|
||||||
|
attributeModifiers: string[]
|
||||||
|
languages: string[]
|
||||||
|
scripts: string[]
|
||||||
|
|
||||||
|
combatTechniques: string[] // TODO
|
||||||
|
combatSpecialAbilities: string[] // TODO
|
||||||
|
|
||||||
|
public inventory: {
|
||||||
|
closeCombatWeapons: DSAMeleeWeapon[] // TODO
|
||||||
|
rangedWeapons: DSARangedWeapon[] // TODO
|
||||||
|
armor: DSAArmor[] // TODO
|
||||||
|
shieldParryWeapon: DSAShieldParryWeapon[] // TODO
|
||||||
|
belongings: DSABaseEquiment[]
|
||||||
|
totalWeight: number // TODO Calculated
|
||||||
|
carryingCapacity: number // TODO Calculated
|
||||||
|
purse: {
|
||||||
|
ducats: number
|
||||||
|
silverthalers: number
|
||||||
|
halers: number
|
||||||
|
kreutzers: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public animal?: {
|
||||||
|
name: string
|
||||||
|
sizeCategory: 'winzig' | 'klein' | 'mittel' | 'groß' | 'riesig'
|
||||||
|
type: string
|
||||||
|
stats: DSAStats
|
||||||
|
attributes: DSAAttributes
|
||||||
|
attack: {
|
||||||
|
attack: number
|
||||||
|
defence: number
|
||||||
|
damagePoints: number
|
||||||
|
armor: number
|
||||||
|
}
|
||||||
|
actions: string[]
|
||||||
|
specialAbilities: string[]
|
||||||
|
image?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
public spellsAndRituals?: { // TODO
|
||||||
|
properties: string[]
|
||||||
|
primaryAttribute: string[]
|
||||||
|
tradition: string[]
|
||||||
|
magicalSpecialAbilities: string[]
|
||||||
|
cantrips: string[]
|
||||||
|
spells?: DSASpell[]
|
||||||
|
}
|
||||||
|
|
||||||
|
public liturgicalChantsAndCeremonies?: { // TODO
|
||||||
|
aspects: string[]
|
||||||
|
primaryAttribute: string[]
|
||||||
|
tradition: string[]
|
||||||
|
blessedSpecialAbilities: string[]
|
||||||
|
blessings: string[]
|
||||||
|
spells?: DSASpell[]
|
||||||
|
}
|
||||||
|
|
||||||
|
constructor(name: string) {
|
||||||
|
super()
|
||||||
|
this.id = crypto.randomUUID()
|
||||||
|
this.personalData.name = name
|
||||||
|
}
|
||||||
|
}
|
25
src/classes/Skill.ts
Normal file
25
src/classes/Skill.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import type {DSAAttributes} from "../types/baseCharacter.ts";
|
||||||
|
import type {DSAImprovements} from "../types/baseDSA.ts";
|
||||||
|
|
||||||
|
export default class Skill{
|
||||||
|
skillName: string
|
||||||
|
attributes: [keyof DSAAttributes, keyof DSAAttributes, keyof DSAAttributes]
|
||||||
|
encumbrance: "YES" | "NO" | "MAYBE"
|
||||||
|
improvement: DSAImprovements
|
||||||
|
skillLevel: number
|
||||||
|
comment: string
|
||||||
|
|
||||||
|
routineCheck() : number{
|
||||||
|
return this.skillLevel >= 13 ? this.skillLevel/2 : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
improvementCost(){
|
||||||
|
return DSAImprovementsTable.getCost(this.improvement, this.skillLevel)
|
||||||
|
}
|
||||||
|
|
||||||
|
improve(){
|
||||||
|
this.skillLevel ++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export
|
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import type {DSACharacter, DSAAttributes} from '../types/character';
|
import type {DSACharacter} from '../types/character';
|
||||||
|
import type {DSAAttributes} from "../types/baseCharacter.ts";
|
||||||
|
|
||||||
interface AttributesProps {
|
interface AttributesProps {
|
||||||
character: DSACharacter;
|
character: DSACharacter;
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import type {DSACharacter} from '../types/character';
|
import type {DSACharacter} from '../types/character';
|
||||||
|
import type {DSAPersonalData} from "../types/baseCharacter.ts";
|
||||||
|
|
||||||
interface BasicInfoProps {
|
interface BasicInfoProps {
|
||||||
character: DSACharacter;
|
character: DSACharacter;
|
||||||
@@ -9,7 +10,7 @@ interface BasicInfoProps {
|
|||||||
|
|
||||||
const BasicInfo: React.FC<BasicInfoProps> = ({ character, setCharacter }) => {
|
const BasicInfo: React.FC<BasicInfoProps> = ({ character, setCharacter }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const updateField = (field: keyof DSACharacter, value: string) => {
|
const updateField = (field: keyof DSACharacter | keyof DSAPersonalData, value: string) => {
|
||||||
setCharacter(prev => ({
|
setCharacter(prev => ({
|
||||||
...prev,
|
...prev,
|
||||||
[field]: value
|
[field]: value
|
||||||
@@ -25,7 +26,7 @@ const BasicInfo: React.FC<BasicInfoProps> = ({ character, setCharacter }) => {
|
|||||||
<input
|
<input
|
||||||
id="name"
|
id="name"
|
||||||
type="text"
|
type="text"
|
||||||
value={character.name}
|
value={character.personalData.name}
|
||||||
onChange={(e) => updateField('name', e.target.value)}
|
onChange={(e) => updateField('name', e.target.value)}
|
||||||
placeholder={t('basicInfo.namePlaceholder')}
|
placeholder={t('basicInfo.namePlaceholder')}
|
||||||
/>
|
/>
|
||||||
@@ -35,7 +36,7 @@ const BasicInfo: React.FC<BasicInfoProps> = ({ character, setCharacter }) => {
|
|||||||
<input
|
<input
|
||||||
id="species"
|
id="species"
|
||||||
type="text"
|
type="text"
|
||||||
value={character.species}
|
value={character.personalData.species}
|
||||||
onChange={(e) => updateField('species', e.target.value)}
|
onChange={(e) => updateField('species', e.target.value)}
|
||||||
placeholder={t('basicInfo.speciesPlaceholder')}
|
placeholder={t('basicInfo.speciesPlaceholder')}
|
||||||
/>
|
/>
|
||||||
@@ -45,7 +46,7 @@ const BasicInfo: React.FC<BasicInfoProps> = ({ character, setCharacter }) => {
|
|||||||
<input
|
<input
|
||||||
id="culture"
|
id="culture"
|
||||||
type="text"
|
type="text"
|
||||||
value={character.culture}
|
value={character.personalData.culture}
|
||||||
onChange={(e) => updateField('culture', e.target.value)}
|
onChange={(e) => updateField('culture', e.target.value)}
|
||||||
placeholder={t('basicInfo.culturePlaceholder')}
|
placeholder={t('basicInfo.culturePlaceholder')}
|
||||||
/>
|
/>
|
||||||
@@ -55,7 +56,7 @@ const BasicInfo: React.FC<BasicInfoProps> = ({ character, setCharacter }) => {
|
|||||||
<input
|
<input
|
||||||
id="profession"
|
id="profession"
|
||||||
type="text"
|
type="text"
|
||||||
value={character.profession}
|
value={character.personalData.profession}
|
||||||
onChange={(e) => updateField('profession', e.target.value)}
|
onChange={(e) => updateField('profession', e.target.value)}
|
||||||
placeholder={t('basicInfo.professionPlaceholder')}
|
placeholder={t('basicInfo.professionPlaceholder')}
|
||||||
/>
|
/>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
// src/components/CharacterSheet.tsx
|
// src/components/CharacterSheet.tsx
|
||||||
import React, { useState } from 'react';
|
import React, {useState} from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import {useTranslation} from 'react-i18next';
|
||||||
import type { DSACharacter } from '../types/character';
|
import type {DSACharacter} from '../types/character';
|
||||||
import BasicInfo from './BasicInfo';
|
import BasicInfo from './BasicInfo';
|
||||||
import Attributes from './Attributes';
|
import Attributes from './Attributes';
|
||||||
import Skills from './Skills';
|
import Skills from './Skills';
|
||||||
@@ -14,93 +14,241 @@ import '../styles/CharacterSheet.css';
|
|||||||
|
|
||||||
// Erweiterte Initial-Daten mit Astralenergie und Zaubern
|
// Erweiterte Initial-Daten mit Astralenergie und Zaubern
|
||||||
const initialCharacter: DSACharacter = {
|
const initialCharacter: DSACharacter = {
|
||||||
id: crypto.randomUUID(),
|
id: crypto.randomUUID(),
|
||||||
|
personalData: {
|
||||||
name: '',
|
name: '',
|
||||||
species: '',
|
species: '',
|
||||||
culture: '',
|
culture: '',
|
||||||
profession: '',
|
profession: '',
|
||||||
experienceLevel: 'Experienced',
|
socialstatus: '',
|
||||||
attributes: {
|
hometown: '',
|
||||||
courage: 8,
|
family: '',
|
||||||
cleverness: 8,
|
looks: {
|
||||||
intuition: 8,
|
age: '',
|
||||||
charisma: 8,
|
haircolor: '',
|
||||||
dexterity: 8,
|
eyecolor: '',
|
||||||
agility: 8,
|
height: '',
|
||||||
constitution: 8,
|
weight: '',
|
||||||
strength: 8
|
characteristics: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
experienceLevel: 'Experienced',
|
||||||
|
health: {
|
||||||
|
lifePoints: {
|
||||||
|
max: 30,
|
||||||
|
current: 30,
|
||||||
|
base: 30,
|
||||||
|
modifier: 0,
|
||||||
|
purchased: 0
|
||||||
},
|
},
|
||||||
skills: {},
|
conditions: [],
|
||||||
spells: {},
|
fatigue: 0,
|
||||||
combat: {
|
pain: 0
|
||||||
lifePoints: { max: 30, current: 30 },
|
},
|
||||||
initiative: 10,
|
attributes: {
|
||||||
speed: 8
|
courage: 8,
|
||||||
|
cleverness: 8,
|
||||||
|
intuition: 8,
|
||||||
|
charisma: 8,
|
||||||
|
dexterity: 8,
|
||||||
|
agility: 8,
|
||||||
|
constitution: 8,
|
||||||
|
strength: 8
|
||||||
|
},
|
||||||
|
skills: {},
|
||||||
|
astral: {
|
||||||
|
spells: {
|
||||||
|
'test': {
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
tradition: [''],
|
||||||
|
attributes: ['courage', 'agility', 'charisma'],
|
||||||
|
skillValue: 0,
|
||||||
|
aspCost: '',
|
||||||
|
castingTime: '',
|
||||||
|
range: '',
|
||||||
|
duration: '',
|
||||||
|
difficulty: 0,
|
||||||
|
description: '',
|
||||||
|
effect: '',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
traditions: [],
|
||||||
astralEnergy: {
|
astralEnergy: {
|
||||||
max: 0,
|
max: 0,
|
||||||
current: 0
|
current: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
karmal: {
|
||||||
|
spells: {
|
||||||
|
'test': {
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
tradition: [''],
|
||||||
|
attributes: ['courage', 'agility', 'charisma'],
|
||||||
|
skillValue: 0,
|
||||||
|
aspCost: '',
|
||||||
|
castingTime: '',
|
||||||
|
range: '',
|
||||||
|
duration: '',
|
||||||
|
difficulty: 0,
|
||||||
|
description: '',
|
||||||
|
effect: '',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
magicalTraditions: [],
|
traditions: [],
|
||||||
advantages: [],
|
karmalEnergy: {
|
||||||
disadvantages: [],
|
max: 0,
|
||||||
equipment: []
|
current: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hasKarmal: false,
|
||||||
|
hasMagic: false,
|
||||||
|
combat: {
|
||||||
|
initiative: 10,
|
||||||
|
speed: 8,
|
||||||
|
armor: {
|
||||||
|
'leather': {
|
||||||
|
encumbrance: 0,
|
||||||
|
equip: {
|
||||||
|
name: 'hello',
|
||||||
|
weight: 0
|
||||||
|
},
|
||||||
|
penalties: 0,
|
||||||
|
protection: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
combatAbilities: {
|
||||||
|
'test': {
|
||||||
|
name: 'test'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dodge: 0,
|
||||||
|
meleeWeapons: {
|
||||||
|
'test': {
|
||||||
|
weapon: {
|
||||||
|
equip: {
|
||||||
|
name: 'test',
|
||||||
|
weight: 0
|
||||||
|
},
|
||||||
|
range: 0,
|
||||||
|
technique: 'test',
|
||||||
|
tp: 0
|
||||||
|
},
|
||||||
|
atpamod: 0,
|
||||||
|
at: 0,
|
||||||
|
damagebonus: 0,
|
||||||
|
pa: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rangedWeapons: {
|
||||||
|
'javelin': {
|
||||||
|
weapon: {
|
||||||
|
equip: {
|
||||||
|
name: '',
|
||||||
|
weight: 0
|
||||||
|
},
|
||||||
|
technique: '',
|
||||||
|
tp: 0,
|
||||||
|
range: 0,
|
||||||
|
},
|
||||||
|
reloaddur: 0,
|
||||||
|
ammo: {
|
||||||
|
equip: {
|
||||||
|
name: '',
|
||||||
|
weight: 0
|
||||||
|
},
|
||||||
|
perUse: 0,
|
||||||
|
count: 0
|
||||||
|
},
|
||||||
|
rangedCombat: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
unarmedAttack: 0,
|
||||||
|
unarmedParry: 0
|
||||||
|
},
|
||||||
|
advantages: [],
|
||||||
|
disadvantages: [],
|
||||||
|
equipment: [],
|
||||||
|
resistances: {
|
||||||
|
spirit: {
|
||||||
|
base: 0,
|
||||||
|
modifier: 0,
|
||||||
|
purchased: 0,
|
||||||
|
max: 0,
|
||||||
|
current: 0
|
||||||
|
},
|
||||||
|
thoughness: {
|
||||||
|
base: 0,
|
||||||
|
modifier: 0,
|
||||||
|
purchased: 0,
|
||||||
|
max: 0,
|
||||||
|
current: 0,
|
||||||
|
},
|
||||||
|
dodge: {
|
||||||
|
base: 0,
|
||||||
|
modifier: 0,
|
||||||
|
purchased: 0,
|
||||||
|
max: 0,
|
||||||
|
current: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const CharacterSheet: React.FC = () => {
|
const CharacterSheet: React.FC = () => {
|
||||||
const { t } = useTranslation();
|
const {t} = useTranslation();
|
||||||
const [character, setCharacter] = useState<DSACharacter>(initialCharacter);
|
const [character, setCharacter] = useState<DSACharacter>(initialCharacter);
|
||||||
|
|
||||||
// Hilfsfunktion um zu prüfen ob Charakter Zauberer ist
|
// Hilfsfunktion um zu prüfen ob Charakter Zauberer ist
|
||||||
const isSpellcaster = character.astralEnergy && character.astralEnergy.max > 0;
|
const isSpellcaster = character.astral.astralEnergy && character.astral.astralEnergy.max > 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="character-sheet">
|
<div className="character-sheet">
|
||||||
<ThemeToggle />
|
<ThemeToggle/>
|
||||||
<LanguageSelector />
|
<LanguageSelector/>
|
||||||
|
|
||||||
<header className="character-sheet-header">
|
<header className="character-sheet-header">
|
||||||
<img
|
<img
|
||||||
src={iconUrl}
|
src={iconUrl}
|
||||||
alt={t('app.iconAlt')}
|
alt={t('app.iconAlt')}
|
||||||
className="character-sheet-icon"
|
className="character-sheet-icon"
|
||||||
/>
|
/>
|
||||||
<h1>{t('app.title')}</h1>
|
<h1>{t('app.title')}</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Grundinformationen */}
|
{/* Grundinformationen */}
|
||||||
<BasicInfo character={character} setCharacter={setCharacter} />
|
<BasicInfo character={character} setCharacter={setCharacter}/>
|
||||||
|
|
||||||
{/* Eigenschaften */}
|
{/* Eigenschaften */}
|
||||||
<Attributes character={character} setCharacter={setCharacter} />
|
<Attributes character={character} setCharacter={setCharacter}/>
|
||||||
|
|
||||||
{/* Kampfwerte */}
|
{/* Kampfwerte */}
|
||||||
<CombatValues character={character} setCharacter={setCharacter} />
|
<CombatValues character={character} setCharacter={setCharacter}/>
|
||||||
|
|
||||||
{/* Fertigkeiten */}
|
{/* Fertigkeiten */}
|
||||||
<Skills character={character} setCharacter={setCharacter} />
|
<Skills character={character} setCharacter={setCharacter}/>
|
||||||
|
|
||||||
{/* Zauber - nur anzeigen wenn Astralenergie > 0 oder explizit gewünscht */}
|
{/* Zauber - nur anzeigen wenn Astralenergie > 0 oder explizit gewünscht */}
|
||||||
{(isSpellcaster || Object.keys(character.spells).length > 0) && (
|
{(isSpellcaster || Object.keys(character.astral.spells).length > 0) && (
|
||||||
<Spells character={character} setCharacter={setCharacter} />
|
<Spells character={character} setCharacter={setCharacter}/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Button zum Hinzufügen von Zaubern falls noch kein Zauberer */}
|
{/* Button zum Hinzufügen von Zaubern falls noch kein Zauberer */}
|
||||||
{!isSpellcaster && Object.keys(character.spells).length === 0 && (
|
{!isSpellcaster && Object.keys(character.astral.spells).length === 0 && (
|
||||||
<div className="add-magic-section">
|
<div className="add-magic-section">
|
||||||
<button
|
<button
|
||||||
className="add-magic-button"
|
className="add-magic-button"
|
||||||
onClick={() => setCharacter(prev => ({
|
onClick={() => setCharacter(prev => ({
|
||||||
...prev,
|
...prev,
|
||||||
astralEnergy: { max: 20, current: 20 }
|
astralEnergy: {max: 20, current: 20}
|
||||||
}))}
|
}))}
|
||||||
>
|
>
|
||||||
{t('spells.addMagic')}
|
{t('spells.addMagic')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CharacterSheet;
|
export default CharacterSheet;
|
||||||
|
@@ -1,3 +1,36 @@
|
|||||||
export interface DSACombatAbilitiy {
|
import type {DSAAttributes} from "./baseCharacter.ts";
|
||||||
name: string;
|
import type {DSABelastungen, DSAImprovements} from "./baseDSA.ts";
|
||||||
|
|
||||||
|
export interface DSABaseAbility {
|
||||||
|
name: string
|
||||||
|
steigerungsfaktor: DSAImprovements
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DSASkill extends DSABaseAbility {
|
||||||
|
attributes: [keyof DSAAttributes, keyof DSAAttributes, keyof DSAAttributes]
|
||||||
|
fertigkeitswert: number
|
||||||
|
belastung: DSABelastungen
|
||||||
|
anmerkung: string
|
||||||
|
routineProbe: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DSACombatTechnique extends DSABaseAbility {
|
||||||
|
primaryAttribute: keyof DSAAttributes
|
||||||
|
kampftechnikwert: number
|
||||||
|
hitcheck: number
|
||||||
|
paradecheck: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DSASpell {
|
||||||
|
name: string
|
||||||
|
check: [keyof DSAAttributes, keyof DSAAttributes, keyof DSAAttributes]
|
||||||
|
skilllevel: number
|
||||||
|
cost: number
|
||||||
|
timeInSec: number
|
||||||
|
range: number
|
||||||
|
duration: number
|
||||||
|
property: string
|
||||||
|
improvement: DSAImprovements
|
||||||
|
effect: string[]
|
||||||
|
special: boolean
|
||||||
}
|
}
|
||||||
|
@@ -5,4 +5,15 @@ export interface BaseAbilities {
|
|||||||
int: number;
|
int: number;
|
||||||
wis: number;
|
wis: number;
|
||||||
cha: number;
|
cha: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface DSAAttributes {
|
||||||
|
courage: number;
|
||||||
|
cleverness: number;
|
||||||
|
intuition: number;
|
||||||
|
charisma: number;
|
||||||
|
dexterity: number;
|
||||||
|
agility: number;
|
||||||
|
constitution: number;
|
||||||
|
strength: number;
|
||||||
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import type {DSACalculatedValue} from "./baseDSA.ts";
|
import type {DSABelastungen, DSACalculatedValue} from "./baseDSA.ts";
|
||||||
|
|
||||||
export interface DSAAttributes {
|
export interface DSAAttributes {
|
||||||
courage: number;
|
courage: number;
|
||||||
@@ -13,33 +13,43 @@ export interface DSAAttributes {
|
|||||||
|
|
||||||
export interface DSAPersonalData {
|
export interface DSAPersonalData {
|
||||||
name: string;
|
name: string;
|
||||||
|
sex?: 'm' | 'w' | 'd';
|
||||||
species: string;
|
species: string;
|
||||||
culture: string;
|
culture: string;
|
||||||
profession: string;
|
profession: string;
|
||||||
socialstatus: string;
|
socialStanding: string;
|
||||||
hometown: string;
|
hometown: string;
|
||||||
|
placeOfBirth?: string;
|
||||||
family: string;
|
family: string;
|
||||||
looks: DSALooks;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DSALooks {
|
|
||||||
age: string;
|
age: string;
|
||||||
haircolor: string;
|
birthdate?: string;
|
||||||
eyecolor: string;
|
hairColor?: string;
|
||||||
height: string;
|
eyeColor?: string;
|
||||||
weight: string;
|
height?: string;
|
||||||
characteristics: string;
|
weight?: string;
|
||||||
|
characteristics?: string[];
|
||||||
|
image?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSAHealth {
|
export interface DSAStats {
|
||||||
lifePoints: DSACalculatedValue;
|
lifePoints: {
|
||||||
conditions: string[];
|
value: DSACalculatedValue;
|
||||||
pain: number;
|
pain: number;
|
||||||
fatigue: number;
|
fatigue: number;
|
||||||
}
|
}
|
||||||
|
conditions?: string[];
|
||||||
export interface DSAResistances {
|
astralEnergy?: DSACalculatedValue;
|
||||||
|
karmaEnergy?: DSACalculatedValue;
|
||||||
spirit: DSACalculatedValue;
|
spirit: DSACalculatedValue;
|
||||||
thoughness: DSACalculatedValue;
|
thoughness: DSACalculatedValue;
|
||||||
dodge: DSACalculatedValue;
|
dodge: DSACalculatedValue;
|
||||||
|
initiative: number; //TODO function?
|
||||||
|
movement: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DSAExperienceLevel {
|
||||||
|
current: "Unerfahren" | "Durchschnittlich" | "Erfahren" | "Kompetent" | "Meisterlich" | "Brillant" | "Legendär"
|
||||||
|
apTotal: number
|
||||||
|
apAvailable: number
|
||||||
|
apSpent: number
|
||||||
}
|
}
|
||||||
|
@@ -1,23 +1,11 @@
|
|||||||
export interface DSACalculatedValue {
|
export interface DSACalculatedValue {
|
||||||
base: number;
|
base: number;
|
||||||
modifier: number;
|
modifier: number;
|
||||||
purchased: number;
|
purchased?: number;
|
||||||
max: number;
|
max: number;
|
||||||
current: number;
|
current: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSAMinMaxValue {
|
export type DSAImprovements = 'A' | 'B' | 'C' | 'D' | 'E' | 'other'
|
||||||
max: number;
|
|
||||||
current: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DSANamedEntity {
|
export type DSABelastungen = 'JA' | 'NEIN' | 'EVTL';
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
description?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DSATimedEffect {
|
|
||||||
duration: string;
|
|
||||||
remaining?: number;
|
|
||||||
}
|
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
export interface DSABaseEquiment {
|
export interface DSABaseEquiment {
|
||||||
name: string;
|
name: string;
|
||||||
weight: number;
|
weight: number;
|
||||||
|
carriedWhere: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSABaseWeapon {
|
export interface DSABaseWeapon extends DSABaseEquiment {
|
||||||
equip: DSABaseEquiment;
|
|
||||||
technique: string;
|
technique: string;
|
||||||
tp: number;
|
tp: number;
|
||||||
range: number;
|
range: number;
|
||||||
|
@@ -1,12 +1,17 @@
|
|||||||
import type {DSAAttributes, DSAHealth, DSAPersonalData, DSAResistances} from "./baseCharacter.ts";
|
import type {DSAAttributes, DSAHealth, DSAPersonalData, DSAResistances} from "./baseCharacter.ts";
|
||||||
import type {DSAArmor, DSAMeleeWeapon, DSARangedWeapon, DSAShield} from "./equiment.ts";
|
import type {DSAArmor, DSAMeleeWeapon, DSARangedWeapon, DSAShield} from "./equiment.ts";
|
||||||
import type {DSACombatAbilitiy} from "./abilities.ts";
|
import type {DSACombatTechnique} from "./abilities.ts";
|
||||||
import type {DSAFatePoints} from "./fatepoints.ts";
|
import type {DSAFatePoints} from "./fatepoints.ts";
|
||||||
|
import type {DSABelastungen, DSAImprovements} from "./baseDSA.ts";
|
||||||
|
|
||||||
export interface DSASkill {
|
export interface DSASkill {
|
||||||
name: string;
|
name: string
|
||||||
attributes: [keyof DSAAttributes, keyof DSAAttributes, keyof DSAAttributes];
|
attributes: [keyof DSAAttributes, keyof DSAAttributes, keyof DSAAttributes]
|
||||||
value: number;
|
fertigkeitswert: number
|
||||||
|
belastung: DSABelastungen
|
||||||
|
steigerungsfaktor: DSAImprovements
|
||||||
|
anmerkung: string
|
||||||
|
routineProbe: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSACombatValues {
|
export interface DSACombatValues {
|
||||||
@@ -19,7 +24,7 @@ export interface DSACombatValues {
|
|||||||
rangedWeapons: DSARangedWeapon[];
|
rangedWeapons: DSARangedWeapon[];
|
||||||
armor: DSAArmor[];
|
armor: DSAArmor[];
|
||||||
shield: DSAShield[];
|
shield: DSAShield[];
|
||||||
combatAbilities: Record<string, DSACombatAbilitiy>;
|
combatAbilities: Record<string, DSACombatTechnique>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSAAstral {
|
export interface DSAAstral {
|
||||||
|
@@ -1,15 +1,4 @@
|
|||||||
export enum DSAConditionType {
|
|
||||||
confusion = "confusion",
|
|
||||||
encumbrance = "encumbrance",
|
|
||||||
fear = "fear",
|
|
||||||
pain = "pain",
|
|
||||||
paralysis = "paralysis",
|
|
||||||
sleep = "sleep",
|
|
||||||
rapture = "rapture",
|
|
||||||
stupor = "stupor",
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DSACondition {
|
export interface DSACondition {
|
||||||
condition: DSAConditionType;
|
condition: "confusion" | "encumbrance" | "fear" | "pain" | "paralysis" | "rapture" | "stupor";
|
||||||
level: number;
|
level: 1 | 2 | 3 | 4;
|
||||||
}
|
}
|
||||||
|
@@ -2,36 +2,31 @@ import type {DSABaseEquiment, DSABaseWeapon} from "./baseEquiment.ts";
|
|||||||
import type {DSACalculatedValue} from "./baseDSA.ts";
|
import type {DSACalculatedValue} from "./baseDSA.ts";
|
||||||
|
|
||||||
|
|
||||||
export interface DSAAmmonution{
|
export interface DSAAmmonution extends DSABaseEquiment {
|
||||||
equip: DSABaseEquiment;
|
|
||||||
perUse: number;
|
perUse: number;
|
||||||
count: number;
|
count: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSAMeleeWeapon{
|
export interface DSAMeleeWeapon extends DSABaseWeapon{
|
||||||
weapon: DSABaseWeapon;
|
|
||||||
atpamod: number;
|
atpamod: number;
|
||||||
damagebonus: number;
|
damagebonus: number;
|
||||||
at: number;
|
at: number;
|
||||||
pa: number;
|
pa: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSARangedWeapon{
|
export interface DSARangedWeapon extends DSABaseWeapon{
|
||||||
weapon: DSABaseWeapon;
|
|
||||||
reloaddur: number;
|
reloaddur: number;
|
||||||
ammo: DSAAmmonution;
|
ammo: DSAAmmonution;
|
||||||
rangedCombat: number;
|
rangedCombat: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSAArmor{
|
export interface DSAArmor extends DSABaseEquiment{
|
||||||
equip: DSABaseEquiment;
|
|
||||||
protection: number;
|
protection: number;
|
||||||
encumbrance: number;
|
encumbrance: number;
|
||||||
penalties: number;
|
penalties: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DSAShield{
|
export interface DSAShieldParryWeapon extends DSABaseEquiment {
|
||||||
equip: DSABaseEquiment;
|
|
||||||
structure: DSACalculatedValue;
|
structure: DSACalculatedValue;
|
||||||
atpamod: number;
|
atpamod: number;
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"erasableSyntaxOnly": false,
|
"erasableSyntaxOnly": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"erasableSyntaxOnly": false,
|
"erasableSyntaxOnly": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user