feat: Implement PF2e Alchemy and Rest system
Alchemy System: - Versatile Vials tracking with refill functionality - Research Field display (Bomber, Chirurgeon, Mutagenist, Toxicologist) - Formula Book with search and level filtering - Advanced Alchemy (daily preparation) for infused items - Quick Alchemy using versatile vials - Normal Alchemy for permanent crafted items - Auto-upgrade system for formula variants (Lesser → Greater) - Effect parsing with damage badges (damage type colors, splash, healing, bonus) - German translations for all UI elements and item effects - WebSocket sync for all alchemy state changes Rest System: - HP healing based on CON modifier × Level - Condition management (Fatigued removed, Doomed/Drained reduced) - Resource reset (spell slots, focus points, daily abilities) - Alchemy reset (infused items expire, vials refilled) - Rest modal with preview of changes Database: - CharacterAlchemyState model for vials and batch tracking - CharacterFormula model for formula book - CharacterPreparedItem model with isInfused flag - Equipment effect field for variant-specific effects - Translation germanEffect field for effect translations - Scraped effect data from Archives of Nethys (205 items) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,6 +97,13 @@ enum TranslationQuality {
|
||||
LOW
|
||||
}
|
||||
|
||||
enum ResearchField {
|
||||
BOMBER
|
||||
CHIRURGEON
|
||||
MUTAGENIST
|
||||
TOXICOLOGIST
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// USER & AUTH
|
||||
// ==========================================
|
||||
@@ -205,6 +212,11 @@ model Character {
|
||||
resources CharacterResource[]
|
||||
battleTokens BattleToken[]
|
||||
documentAccess DocumentAccess[]
|
||||
|
||||
// Alchemy
|
||||
alchemyState CharacterAlchemyState?
|
||||
formulas CharacterFormula[]
|
||||
preparedItems CharacterPreparedItem[]
|
||||
}
|
||||
|
||||
model CharacterAbility {
|
||||
@@ -308,6 +320,56 @@ model CharacterResource {
|
||||
@@unique([characterId, name])
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// ALCHEMY SYSTEM
|
||||
// ==========================================
|
||||
|
||||
model CharacterAlchemyState {
|
||||
id String @id @default(uuid())
|
||||
characterId String @unique
|
||||
researchField ResearchField?
|
||||
versatileVialsCurrent Int @default(0)
|
||||
versatileVialsMax Int @default(0)
|
||||
advancedAlchemyBatch Int @default(0)
|
||||
advancedAlchemyMax Int @default(0)
|
||||
lastRestAt DateTime?
|
||||
|
||||
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model CharacterFormula {
|
||||
id String @id @default(uuid())
|
||||
characterId String
|
||||
equipmentId String
|
||||
name String
|
||||
nameGerman String?
|
||||
learnedAt Int @default(1)
|
||||
formulaSource String? // "Pathbuilder Import", "Purchased", "Found"
|
||||
|
||||
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
||||
equipment Equipment @relation(fields: [equipmentId], references: [id])
|
||||
|
||||
@@unique([characterId, equipmentId])
|
||||
@@index([characterId])
|
||||
}
|
||||
|
||||
model CharacterPreparedItem {
|
||||
id String @id @default(uuid())
|
||||
characterId String
|
||||
equipmentId String
|
||||
name String
|
||||
nameGerman String?
|
||||
quantity Int @default(1)
|
||||
isQuickAlchemy Boolean @default(false)
|
||||
isInfused Boolean @default(true) // Infused items expire on rest, permanent items don't
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
character Character @relation(fields: [characterId], references: [id], onDelete: Cascade)
|
||||
equipment Equipment @relation(fields: [equipmentId], references: [id])
|
||||
|
||||
@@index([characterId])
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// BATTLE SYSTEM
|
||||
// ==========================================
|
||||
@@ -558,8 +620,11 @@ model Equipment {
|
||||
activation String? // "Cast A Spell", "[one-action]", etc.
|
||||
duration String?
|
||||
usage String?
|
||||
effect String? // Specific effect text for item variants (Lesser, Moderate, Greater, Major)
|
||||
|
||||
characterItems CharacterItem[]
|
||||
characterItems CharacterItem[]
|
||||
formulas CharacterFormula[]
|
||||
preparedItems CharacterPreparedItem[]
|
||||
}
|
||||
|
||||
model Spell {
|
||||
@@ -596,6 +661,7 @@ model Translation {
|
||||
germanName String
|
||||
germanSummary String?
|
||||
germanDescription String?
|
||||
germanEffect String? // Translated effect text for alchemical items
|
||||
quality TranslationQuality @default(MEDIUM)
|
||||
translatedBy String @default("claude-api")
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
Reference in New Issue
Block a user