use voiceId value directly when generating a bot + updated type to use mongoid
This commit is contained in:
@@ -235,11 +235,7 @@ public class BotGenerator(
|
|||||||
botGenerationDetails.Role
|
botGenerationDetails.Role
|
||||||
);
|
);
|
||||||
bot.Info.Settings.UseSimpleAnimator = botJsonTemplate.BotExperience.UseSimpleAnimator;
|
bot.Info.Settings.UseSimpleAnimator = botJsonTemplate.BotExperience.UseSimpleAnimator;
|
||||||
var chosenVoiceName = weightedRandomHelper.GetWeightedValue(botJsonTemplate.BotAppearance.Voice);
|
bot.Customization.Voice = weightedRandomHelper.GetWeightedValue(botJsonTemplate.BotAppearance.Voice);
|
||||||
bot.Customization.Voice = databaseService
|
|
||||||
.GetCustomization()
|
|
||||||
.FirstOrDefault(customisation => customisation.Value.Name.Equals(chosenVoiceName, StringComparison.OrdinalIgnoreCase))
|
|
||||||
.Key;
|
|
||||||
bot.Health = GenerateHealth(botJsonTemplate.BotHealth, botGenerationDetails.IsPlayerScav);
|
bot.Health = GenerateHealth(botJsonTemplate.BotHealth, botGenerationDetails.IsPlayerScav);
|
||||||
bot.Skills = GenerateSkills(botJsonTemplate.BotSkills);
|
bot.Skills = GenerateSkills(botJsonTemplate.BotSkills);
|
||||||
bot.Info.PrestigeLevel = 0;
|
bot.Info.PrestigeLevel = 0;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System.Text.Json;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Bot.GlobalSettings;
|
using SPTarkov.Server.Core.Models.Eft.Bot.GlobalSettings;
|
||||||
@@ -58,7 +57,7 @@ public record Appearance
|
|||||||
|
|
||||||
[JsonPropertyName("voice")]
|
[JsonPropertyName("voice")]
|
||||||
[JsonConverter(typeof(ArrayToObjectFactoryConverter))]
|
[JsonConverter(typeof(ArrayToObjectFactoryConverter))]
|
||||||
public Dictionary<string, double> Voice { get; set; }
|
public Dictionary<MongoId, double> Voice { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public record Chances
|
public record Chances
|
||||||
|
|||||||
Reference in New Issue
Block a user