diff --git a/backend/models/model_gsmaster.go b/backend/models/model_gsmaster.go index eb191ee..6ebd0b2 100644 --- a/backend/models/model_gsmaster.go +++ b/backend/models/model_gsmaster.go @@ -26,7 +26,7 @@ type Magisch struct { type LookupList struct { ID uint `gorm:"primaryKey" json:"id"` //`gorm:"default:uuid_generate_v3()"` // db func - GameSystem string `gorm:"column:game_system;index;default:midgard" json:"game_system"` + GameSystem string `gorm:"column:game_system;index" json:"game_system"` Name string `gorm:"type:varchar(255);index" json:"name"` Beschreibung string `json:"beschreibung"` Quelle string `json:"quelle"` // Deprecated: Für Rückwärtskompatibilität @@ -35,7 +35,7 @@ type LookupList struct { } type LearnCost struct { - GameSystem string `gorm:"column:game_system;index;default:midgard" json:"game_system"` + GameSystem string `gorm:"column:game_system;index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` Stufe int `json:"stufe"` LE int `json:"le"` @@ -47,7 +47,7 @@ type LearnCost struct { type Skill struct { ID uint `gorm:"primaryKey" json:"id"` - GameSystem string `gorm:"column:game_system;index;default:midgard" json:"game_system"` + GameSystem string `gorm:"column:game_system;index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` Name string `gorm:"type:varchar(255);index" json:"name"` Beschreibung string `json:"beschreibung"` @@ -69,7 +69,7 @@ type WeaponSkill struct { type Spell struct { ID uint `gorm:"primaryKey" json:"id"` - GameSystem string `gorm:"column:game_system;index;default:midgard" json:"game_system"` + GameSystem string `gorm:"column:game_system;index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` Name string `gorm:"type:varchar(255);index" json:"name"` Beschreibung string `json:"beschreibung"` @@ -92,7 +92,7 @@ type Spell struct { type Equipment struct { ID uint `gorm:"primaryKey" json:"id"` - GameSystem string `gorm:"column:game_system;index;default:midgard" json:"game_system"` + GameSystem string `gorm:"column:game_system;index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` Name string `gorm:"type:varchar(255);index" json:"name"` Beschreibung string `json:"beschreibung"` @@ -125,7 +125,7 @@ type Transportation struct { type Believe struct { ID uint `gorm:"primaryKey" json:"id"` - GameSystem string `gorm:"column:game_system;index;default:midgard" json:"game_system"` + GameSystem string `gorm:"column:game_system;index" json:"game_system"` Name string `gorm:"type:varchar(255);index" json:"name"` Beschreibung string `json:"beschreibung"` Quelle string `json:"quelle"` // Deprecated: Für Rückwärtskompatibilität @@ -137,7 +137,7 @@ type Believe struct { // MiscLookup represents miscellaneous lookup values like gender, race, origin, etc. type MiscLookup struct { ID uint `gorm:"primaryKey" json:"id"` - GameSystem string `gorm:"column:game_system;index;default:midgard" json:"game_system"` + GameSystem string `gorm:"column:game_system;index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` Key string `gorm:"column:key;type:varchar(50);index;not null" json:"key"` Value string `gorm:"type:varchar(255);not null" json:"value"` diff --git a/backend/models/model_learning_costs.go b/backend/models/model_learning_costs.go index 4cf1a03..ee3cb6f 100644 --- a/backend/models/model_learning_costs.go +++ b/backend/models/model_learning_costs.go @@ -20,7 +20,7 @@ type Source struct { Description string `json:"description,omitempty"` // Beschreibung des Werks IsCore bool `json:"is_core"` // Ist es ein Grundregelwerk? IsActive bool `json:"is_active"` // Ist das Werk aktiv/verfügbar? - GameSystem string `gorm:"index;default:midgard" json:"game_system"` + GameSystem string `gorm:"index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` } @@ -31,7 +31,7 @@ type CharacterClass struct { Name string `gorm:"unique;not null" json:"name"` // z.B. "Hexer", "Magier", "Krieger" Description string `json:"description,omitempty"` // Optional: Beschreibung der Klasse SourceID uint `gorm:"not null;index" json:"source_id"` // Verweis auf das Quellenbuch - GameSystem string `gorm:"index;default:midgard" json:"game_system"` + GameSystem string `gorm:"index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` Source Source `gorm:"foreignKey:SourceID;constraint:OnUpdate:CASCADE,OnDelete:RESTRICT" json:"source"` Quelle string `gorm:"index;size:3;default:KOD" json:"quelle,omitempty"` // Optional: Quelle der Kategorie, falls abweichend @@ -42,7 +42,7 @@ type SkillCategory struct { ID uint `gorm:"primaryKey" json:"id"` Name string `gorm:"unique;not null" json:"name"` // z.B. "Alltag", "Kampf", "Waffen" SourceID uint `gorm:"not null;index" json:"source_id"` // Verweis auf das Quellenbuch - GameSystem string `gorm:"index;default:midgard" json:"game_system"` + GameSystem string `gorm:"index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` Source Source `gorm:"foreignKey:SourceID;constraint:OnUpdate:CASCADE,OnDelete:RESTRICT" json:"source"` Quelle string `gorm:"index;size:3;default:KOD" json:"quelle,omitempty"` // Optional: Quelle der Kategorie, falls abweichend @@ -53,7 +53,7 @@ type SkillDifficulty struct { ID uint `gorm:"primaryKey" json:"id"` Name string `gorm:"unique;not null" json:"name"` // z.B. "leicht", "normal", "schwer", "sehr schwer" Description string `json:"description,omitempty"` // Optional: Beschreibung - GameSystem string `gorm:"index;default:midgard" json:"game_system"` + GameSystem string `gorm:"index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` } @@ -63,7 +63,7 @@ type SpellSchool struct { Name string `gorm:"unique;not null" json:"name"` // z.B. "Beherrschen", "Bewegen", "Erkennen" Description string `json:"description,omitempty"` // Optional: Beschreibung SourceID uint `gorm:"not null;index" json:"source_id"` // Verweis auf das Quellenbuch - GameSystem string `gorm:"index;default:midgard" json:"game_system"` + GameSystem string `gorm:"index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` Source Source `gorm:"foreignKey:SourceID;constraint:OnUpdate:CASCADE,OnDelete:RESTRICT" json:"source"` Quelle string `gorm:"index;size:3;default:KOD" json:"quelle,omitempty"` // Optional: Quelle der Kategorie, falls abweichend @@ -98,7 +98,7 @@ type SpellLevelLECost struct { ID uint `gorm:"primaryKey" json:"id"` Level int `gorm:"uniqueIndex;not null" json:"level"` // Zauber-Stufe (1-12) LERequired int `gorm:"not null" json:"le_required"` // Benötigte Lerneinheiten - GameSystem string `gorm:"index;default:midgard" json:"game_system"` + GameSystem string `gorm:"index" json:"game_system"` GameSystemId uint `json:"game_system_id,omitempty"` } diff --git a/frontend/src/components/SkillImproveDialog.vue b/frontend/src/components/SkillImproveDialog.vue index f196cfb..7842a53 100644 --- a/frontend/src/components/SkillImproveDialog.vue +++ b/frontend/src/components/SkillImproveDialog.vue @@ -130,7 +130,7 @@ @click="selectLevel(level)" >
- {{ skill?.fertigkeitswert || 0 }} → {{ level.targetLevel }} + {{ level.startLevel }} → {{ level.targetLevel }} {{ level.epCost }} EP + {{ level.goldCost }} GS {{ level.epCost }} EP {{ Math.floor(level.epCost / 2) }} EP @@ -507,6 +507,7 @@ export default { } return { + startLevel: Math.max(cost.target_level - 1, 0), targetLevel: cost.target_level, epCost: cost.ep, goldCost: cost.gold_cost, @@ -581,6 +582,7 @@ export default { } this.availableLevels.push({ + startLevel: targetLevel - 1, targetLevel, epCost, goldCost,