forked from Shardstone/trail-into-darkness
Added a bunch of utilities and modfief the character data structue
This commit is contained in:
@@ -27,6 +27,7 @@ namespace Nox.Game {
|
||||
public EntityStats stats;
|
||||
public EntityAttributes attributes;
|
||||
public PerksData perksData = new();
|
||||
public ModifiersData modifiersData = new();
|
||||
}
|
||||
|
||||
public sealed class CharacterFactory : ICharacterFactory {
|
||||
@@ -49,6 +50,7 @@ namespace Nox.Game {
|
||||
}
|
||||
|
||||
var attributes = attributesFactory.Create(request.attributes);
|
||||
var stats = statsFactory.Create(request.attributes);
|
||||
|
||||
var character = new CharacterDefinition {
|
||||
ID = string.IsNullOrWhiteSpace(request.id) ? Guid.NewGuid().ToString("N") : request.id,
|
||||
@@ -57,14 +59,9 @@ namespace Nox.Game {
|
||||
@class = request.characterClass,
|
||||
role = CharacterRole.Protagonist,
|
||||
Attributes = attributes,
|
||||
Stats = {
|
||||
level = statsFactory.Create(attributes).level,
|
||||
health = statsFactory.Create(attributes).health,
|
||||
stamina = statsFactory.Create(attributes).stamina,
|
||||
experience = statsFactory.Create(attributes).experience
|
||||
},
|
||||
perksData = new PerksData(),
|
||||
activeModifiers = new ModifiersData()
|
||||
Stats = stats,
|
||||
perksData = request.perksData ?? new PerksData(),
|
||||
activeModifiers = request.modifiersData ?? new ModifiersData()
|
||||
};
|
||||
|
||||
AddStartingPerks(character, request.perksData);
|
||||
|
||||
Reference in New Issue
Block a user