From 66f3adc5f9422d66587431f0e559f70c7367df1e Mon Sep 17 00:00:00 2001 From: Ilya Kozhemyakin Date: Sat, 13 Sep 2025 18:35:25 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B3=D0=BE=D1=82=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D1=81=D1=83=D1=89=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8=20=D0=B1=D0=BE=D0=B6=D0=B5=D1=81=D1=82=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Aonprd/Processors/Types/DeityProcessor.cs | 52 +++++++++++++++++++ Pf2eModel/Model/Structure/Deity.cs | 31 ++++++++++- Pf2eModel/Pf2eDbContextModel.cs | 10 ++-- 3 files changed, 88 insertions(+), 5 deletions(-) diff --git a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs index bcaf0b4..db7124d 100644 --- a/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs +++ b/Pf2eDataScrapper/Importers/Implementations/Aonprd/Processors/Types/DeityProcessor.cs @@ -101,9 +101,61 @@ internal partial class DeityProcessor( /// private void ProcessSanctification() { + // Получаем выравнивание божества + string? deityAlignment = Input.GetOptional("alignment"); + // По умолчанию любое освящение Object.Sanctification = DeitySanctification.Any; Object.SanctificationMust = false; + + // Определяем освящение на основе выравнивания божества + if (!string.IsNullOrEmpty(deityAlignment)) + { + switch (deityAlignment) + { + case "LG": + case "NG": + case "CG": + Object.Sanctification = DeitySanctification.Holy; + break; + case "LE": + case "NE": + case "CE": + Object.Sanctification = DeitySanctification.Unholy; + break; + case "N": + case "LN": + case "CN": + case "Any": + Object.Sanctification = DeitySanctification.Any; + break; + } + } + + // Проверяем, требует ли божество определенного выравнивания от последователей + JArray? followerAlignments = Input.GetOptional("follower_alignment"); + if (followerAlignments != null && followerAlignments.Count > 0) + { + // Если выравнивание последователей ограничено, то освящение обязательно + Object.SanctificationMust = true; + + // Если освящение Any, но выравнивания последователей ограничены только добрыми или злыми, + // уточняем тип освящения + if (Object.Sanctification == DeitySanctification.Any) + { + bool allGood = followerAlignments.All(a => a.ToString() is "LG" or "NG" or "CG"); + bool allEvil = followerAlignments.All(a => a.ToString() is "LE" or "NE" or "CE"); + + if (allGood) + { + Object.Sanctification = DeitySanctification.Holy; + } + else if (allEvil) + { + Object.Sanctification = DeitySanctification.Unholy; + } + } + } } /// diff --git a/Pf2eModel/Model/Structure/Deity.cs b/Pf2eModel/Model/Structure/Deity.cs index 0f34c08..58dc4ba 100644 --- a/Pf2eModel/Model/Structure/Deity.cs +++ b/Pf2eModel/Model/Structure/Deity.cs @@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; using Pf2eModel.Model.Base; using Pf2eModel.Model.Common; +using Pf2eModel.Model.Common.I18n; using Pf2eModel.Model.Enum; using Pf2eModel.Model.Structure.DeityRelation; @@ -53,7 +54,35 @@ public class Deity : IEntity public bool SanctificationMust { get; set; } /// - /// Аттрибуты божества. + /// Заветы божества. + /// + [Column(Order = 6)] + [Comment("Заветы божества")] + public LocaleString Edicts { get; set; } = null!; + + /// + /// Анафемы божества. + /// + [Column(Order = 7)] + [Comment("Анафемы божества")] + public LocaleString Anathema { get; set; } = null!; + + /// + /// Религиозный символ божества. + /// + [Column(Order = 8)] + [Comment("Религиозный символ божества")] + public LocaleString ReligiousSymbol { get; set; } = null!; + + /// + /// Священное животное божества. + /// + [Column(Order = 9)] + [Comment("Священное животное божества")] + public LocaleString SacredAnimal { get; set; } = null!; + + /// + /// Атрибуты божества. /// public ICollection DeityAttributes { get; set; } = new List(); diff --git a/Pf2eModel/Pf2eDbContextModel.cs b/Pf2eModel/Pf2eDbContextModel.cs index d94525a..d343fb6 100644 --- a/Pf2eModel/Pf2eDbContextModel.cs +++ b/Pf2eModel/Pf2eDbContextModel.cs @@ -434,6 +434,11 @@ public partial class Pf2eDbContext { BindEntity(entity); + BindLocaleString(entity, d => d.Anathema); + BindLocaleString(entity, d => d.Edicts); + BindLocaleString(entity, d => d.ReligiousSymbol); + BindLocaleString(entity, d => d.SacredAnimal); + entity .HasMany(e => e.DeityAttributes) .WithOne(e => e.Deity) @@ -461,10 +466,7 @@ public partial class Pf2eDbContext entity.HasMany(e => e.Skills).WithMany(); }); modelBuilder.Entity(entity => { }); - modelBuilder.Entity(entity => - { - // Связь теперь настроена в конфигурации Domain - }); + modelBuilder.Entity(entity => { }); modelBuilder.Entity(entity => { entity