public IPerson Create(string personSchemeSid, IFraction fraction)
        {
            var personScheme = _schemeService.GetScheme <IPersonScheme>(personSchemeSid);

            var person = new HumanPerson(personScheme, fraction);

            var attributes = new[]
            {
                new PersonAttribute(PersonAttributeType.PhysicalStrength, 10),
                new PersonAttribute(PersonAttributeType.Dexterity, 10),
                new PersonAttribute(PersonAttributeType.Perception, 10),
                new PersonAttribute(PersonAttributeType.Constitution, 10)
            };
            var attributesModule = new AttributesModule(attributes);

            person.AddModule(attributesModule);

            var inventoryModule = new InventoryModule();

            person.AddModule(inventoryModule);

            var equipmentModule = new EquipmentModule(personScheme.Slots);

            person.AddModule(equipmentModule);

            var сonditionModule = new ConditionsModule();

            person.AddModule(сonditionModule);

            var evolutionModule = new EvolutionModule(_schemeService);

            person.AddModule(evolutionModule);

            var survivalModule = new HumanSurvivalModule(personScheme, _survivalRandomSource, attributesModule,
                                                         сonditionModule, evolutionModule, equipmentModule);

            person.AddModule(survivalModule);

            var defaultActScheme  = _schemeService.GetScheme <ITacticalActScheme>(person.Scheme.DefaultActs.First());
            var defaultActSchemes = new[] { defaultActScheme };
            var combatActModule   = new CombatActModule(
                defaultActSchemes,
                equipmentModule,
                сonditionModule,
                evolutionModule);

            person.AddModule(combatActModule);

            var combatStatsModule = new CombatStatsModule(evolutionModule, equipmentModule);

            person.AddModule(combatStatsModule);

            var diseaseModule = new DiseaseModule(сonditionModule);

            person.AddModule(diseaseModule);

            return(person);
        }
Ejemplo n.º 2
0
        public IPerson Create(string personSchemeSid)
        {
            var personScheme = _schemeService.GetScheme <IPersonScheme>(personSchemeSid);

            var person = new HumanPerson(personScheme);

            var attributeModule = RollAndAddPersonAttributesToPerson(person);

            var movingModule = new MovingModule(attributeModule);

            person.AddModule(movingModule);

            var inventoryModule = new InventoryModule();

            person.AddModule(inventoryModule);

            var equipmentModule = new EquipmentModule(personScheme.Slots);

            person.AddModule(equipmentModule);

            var effectsModule = new EffectsModule();

            person.AddModule(effectsModule);

            var evolutionModule = new EvolutionModule(_schemeService);

            person.AddModule(evolutionModule);
            RollTraitPerks(evolutionModule);

            var survivalModule = new HumanSurvivalModule(personScheme, _survivalRandomSource, attributeModule, effectsModule, evolutionModule, equipmentModule)
            {
                PlayerEventLogService = PlayerEventLogService
            };

            person.AddModule(survivalModule);

            RollStartEquipment(inventoryModule, person);

            var defaultActScheme = _schemeService.GetScheme <ITacticalActScheme>(person.Scheme.DefaultAct);
            var combatActModule  = new CombatActModule(defaultActScheme, equipmentModule, effectsModule, evolutionModule);

            person.AddModule(combatActModule);

            var combatStatsModule = new CombatStatsModule(evolutionModule, equipmentModule);

            person.AddModule(combatStatsModule);

            var diseaseModule = new DiseaseModule();

            person.AddModule(diseaseModule);

            person.PlayerEventLogService = PlayerEventLogService;

            return(person);
        }
Ejemplo n.º 3
0
        public IPerson Create(string personSchemeSid, IFraction fraction)
        {
            var personScheme = SchemeService.GetScheme <IPersonScheme>(personSchemeSid);

            var person = new HumanPerson(personScheme, fraction);

            var attributeModule = RollAndAddPersonAttributesToPerson(person);

            var movingModule = new MovingModule(attributeModule);

            person.AddModule(movingModule);

            var inventoryModule = new InventoryModule();

            person.AddModule(inventoryModule);

            var notNullSlots    = personScheme.Slots.Select(x => x !).ToArray();
            var equipmentModule = new EquipmentModule(notNullSlots);

            person.AddModule(equipmentModule);

            var effectsModule = new ConditionsModule();

            person.AddModule(effectsModule);

            var evolutionModule = new EvolutionModule(SchemeService);

            person.AddModule(evolutionModule);
            RollTraitPerks(evolutionModule);

            var survivalModule = new HumanSurvivalModule(personScheme, _survivalRandomSource, attributeModule,
                                                         effectsModule, evolutionModule, equipmentModule)
            {
                PlayerEventLogService = PlayerEventLogService
            };

            person.AddModule(survivalModule);

            RollStartEquipment(inventoryModule, person);

            if (person.Scheme.DefaultActs is null)
            {
                throw new InvalidOperationException();
            }

            var defaultActSchemes =
                person.Scheme.DefaultActs.Select(x => SchemeService.GetScheme <ITacticalActScheme>(x));
            var combatActModule = new CombatActModule(
                defaultActSchemes,
                equipmentModule,
                effectsModule,
                evolutionModule);

            person.AddModule(combatActModule);

            var combatStatsModule = new CombatStatsModule(evolutionModule, equipmentModule);

            person.AddModule(combatStatsModule);

            var diseaseModule = new DiseaseModule(effectsModule);

            person.AddModule(diseaseModule);

            var fowModule = new FowData();

            person.AddModule(fowModule);

            person.PlayerEventLogService = PlayerEventLogService;

            return(person);
        }