Files
trail-into-darkness/Assets/Code/GameState/Entities/PartyCreatorModel.cs
2026-03-19 18:12:07 +01:00

61 lines
2.9 KiB
C#

namespace Nox.Game {
public class PartyCreatorModel {
private readonly ICharacterFactory characterFactory;
private readonly IPartyFactory partyFactory;
public PartyCreatorModel(ICharacterFactory characterFactory, IPartyFactory partyFactory) {
this.characterFactory = characterFactory;
this.partyFactory = partyFactory;
}
public PartyData CreatePartyForNewRun(int companionCount) {
var protagonist = characterFactory.CreateCustomProtagonist(new CustomCharacterCreationRequest {
id = "protagonist",
displayName = "The Warden",
mightPoints = 4,
reflexPoints = 3,
knowledgePoints = 3,
startingPerkIds = new System.Collections.Generic.List<string> { "iron-will" }
});
CharacterTemplate[] companionTemplates = {
new() {
id = "companion-bruiser",
displayName = "Rook",
attributes = new CharacterAttributes { might = 5, reflex = 2, knowledge = 1 },
startingPerkIds = new System.Collections.Generic.List<string> { "steadfast" }
},
new() {
id = "companion-scout",
displayName = "Sable",
attributes = new CharacterAttributes { might = 2, reflex = 5, knowledge = 1 },
startingPerkIds = new System.Collections.Generic.List<string> { "nimble-step" }
},
new() {
id = "companion-scholar",
displayName = "Quill",
attributes = new CharacterAttributes { might = 1, reflex = 2, knowledge = 5 },
startingPerkIds = new System.Collections.Generic.List<string> { "lorekeeper" }
},
new() {
id = "companion-vanguard",
displayName = "Brant",
attributes = new CharacterAttributes { might = 4, reflex = 3, knowledge = 2 },
startingPerkIds = new System.Collections.Generic.List<string> { "bulwark" }
},
new() {
id = "companion-tracker",
displayName = "Mira",
attributes = new CharacterAttributes { might = 2, reflex = 4, knowledge = 3 },
startingPerkIds = new System.Collections.Generic.List<string> { "pathfinder" }
}
};
var companions = new System.Collections.Generic.List<CharacterData>();
for(var i = 0; i < companionCount && i < companionTemplates.Length; i++) {
companions.Add(characterFactory.CreateFromTemplate(companionTemplates[i], CharacterRole.Companion));
}
return partyFactory.Create(protagonist, companions);
}
}
}