added full characte creation support

This commit is contained in:
Sebastian Bularca
2026-04-06 01:05:20 +02:00
parent 419201f2a5
commit 50832c491c
20 changed files with 1037 additions and 265 deletions

View File

@@ -9,6 +9,7 @@ namespace Nox.Game {
public interface IEntityDefinition {
Guid Id { get; }
string Name { get; }
int PortraitIndex { get; }
CharacterRace Race { get; }
CharacterClass Class { get; }
CharacterRole Role { get; }
@@ -22,7 +23,7 @@ namespace Nox.Game {
public enum StatType {
None,
Health,
Stamina,
Mana,
Level,
Experience
}
@@ -129,6 +130,7 @@ namespace Nox.Game {
[Serializable]
public class CharacterDefinition : IEntityDefinition {
public Guid Id { get; set; }
public int PortraitIndex { get; set; } = 0;
[field: SerializeField] public string Name { get; set; }
[field: SerializeField] public CharacterRace Race { get; set; }
[field: SerializeField] public CharacterClass Class { get; set; }
@@ -156,17 +158,18 @@ namespace Nox.Game {
Id = p.Id,
Name = p.Name,
Modifiers = p.Modifiers
}).ToList() ?? new()
}).ToList() ?? new List<PerkDefinition>()
},
Modifiers = new ModifiersData {
modifiers = Modifiers?.modifiers?.AsValueEnumerable().Select(m => new ModifierDefinition {
Id = m.Id,
Name = m.Name,
StatType = m.StatType,
AttributeType = m.AttributeType,
Target = m.Target,
ScalingSource = m.ScalingSource,
Operation = m.Operation,
Value = m.Value
}).ToList() ?? new()
Value = m.Value,
Requirements = m.Requirements?.ToList() ?? new List<ModifierRequirement>()
}).ToList() ?? new List<ModifierDefinition>()
}
};
}