forked from Shardstone/trail-into-darkness
46 lines
1.9 KiB
C#
46 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace Nox.Game {
|
|
public class PartyCreatorModel {
|
|
private readonly ICharacterFactory characterFactory;
|
|
private readonly IPartyFactory partyFactory;
|
|
public PartyCreatorModel(ICharacterFactory characterFactory, IPartyFactory partyFactory, DefaultPartySettings defaultPartySettings) {
|
|
this.characterFactory = characterFactory;
|
|
this.partyFactory = partyFactory;
|
|
}
|
|
public PartyDefinition CreatePartyForNewRun(int companionCount) {
|
|
var protagonist = characterFactory.CreateCustomProtagonist(new CustomCharacterCreationRequest {
|
|
displayName = "John Doe",
|
|
attributes = new EntityAttributes(),
|
|
perks = new PerksData(){
|
|
perks = new List<PerkDefinition>()
|
|
}
|
|
});
|
|
|
|
var rook_attributes = new EntityAttributes();
|
|
rook_attributes.attributes = new[] {
|
|
new Attribute(AttributeType.Might, 6),
|
|
new Attribute(AttributeType.Knowledge, 2),
|
|
new Attribute(AttributeType.Perception, 2),
|
|
new Attribute(AttributeType.Reflex, 4)
|
|
};
|
|
CharacterTemplate[] companionTemplates = {
|
|
new() {
|
|
displayName = "Rook",
|
|
attributes = rook_attributes,
|
|
perksData = new PerksData(){
|
|
perks = new List<PerkDefinition>()
|
|
}
|
|
}
|
|
};
|
|
|
|
var companions = new List<CharacterDefinition>();
|
|
for(var i = 0; i < companionCount && i < companionTemplates.Length; i++) {
|
|
companions.Add(characterFactory.CreateFromTemplate(companionTemplates[i], CharacterRole.Companion));
|
|
}
|
|
|
|
return partyFactory.Create(protagonist, companions);
|
|
}
|
|
}
|
|
}
|