Updated to store experience/aggressor bonus/exp reward in dictionaries keyed by bot difficulty
This commit is contained in:
parent
8c0db8e0c2
commit
5083c7c5c3
@ -70,16 +70,16 @@ public class Experience
|
|||||||
public Experience()
|
public Experience()
|
||||||
{
|
{
|
||||||
level = new MinMax(0, 1);
|
level = new MinMax(0, 1);
|
||||||
reward = new MinMax(-1, -1);
|
reward = new Dictionary<string, MinMax>();
|
||||||
standingForKill = new Dictionary<string, object>();
|
standingForKill = new Dictionary<string, object>();
|
||||||
aggressorBonus = null;
|
aggressorBonus = new Dictionary<string, object>(); ;
|
||||||
useSimpleAnimator = false;
|
useSimpleAnimator = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinMax level { get; set; }
|
public MinMax level { get; set; }
|
||||||
public MinMax reward { get; set; }
|
public Dictionary<string, MinMax> reward { get; set; }
|
||||||
public Dictionary<string, object> standingForKill { get; set; }
|
public Dictionary<string, object> standingForKill { get; set; }
|
||||||
public object aggressorBonus { get; set; }
|
public new Dictionary<string, object> aggressorBonus { get; set; }
|
||||||
public bool useSimpleAnimator { get; set; }
|
public bool useSimpleAnimator { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ namespace Generator
|
|||||||
UpdateBodyPartHealth(botData, rawBotData);
|
UpdateBodyPartHealth(botData, rawBotData);
|
||||||
AddExperience(botData, rawBotData);
|
AddExperience(botData, rawBotData);
|
||||||
AddStandingForKill(botData, rawBotData);
|
AddStandingForKill(botData, rawBotData);
|
||||||
|
AddAggressorBonus(botData, rawBotData);
|
||||||
AddSkills(botData, rawBotData);
|
AddSkills(botData, rawBotData);
|
||||||
botData.experience.useSimpleAnimator = rawBotData.Info.Settings.UseSimpleAnimator;
|
botData.experience.useSimpleAnimator = rawBotData.Info.Settings.UseSimpleAnimator;
|
||||||
|
|
||||||
@ -47,14 +48,33 @@ namespace Generator
|
|||||||
{
|
{
|
||||||
botToUpdate.experience.standingForKill.Add(rawBotData.Info.Settings.BotDifficulty, rawBotData.Info.Settings.StandingForKill);
|
botToUpdate.experience.standingForKill.Add(rawBotData.Info.Settings.BotDifficulty, rawBotData.Info.Settings.StandingForKill);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
botToUpdate.experience.aggressorBonus ??= rawBotData.Info.Settings.AggressorBonus;
|
private static void AddAggressorBonus(Bot botToUpdate, Datum rawBotData)
|
||||||
|
{
|
||||||
|
botToUpdate.experience.aggressorBonus ??= new Dictionary<string, object>();
|
||||||
|
|
||||||
|
if (!botToUpdate.experience.aggressorBonus.ContainsKey(rawBotData.Info.Settings.BotDifficulty))
|
||||||
|
{
|
||||||
|
botToUpdate.experience.aggressorBonus.Add(rawBotData.Info.Settings.BotDifficulty, rawBotData.Info.Settings.AggressorBonus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AddExperience(Bot botToUpdate, Datum rawBotData)
|
private static void AddExperience(Bot botToUpdate, Datum rawBotData)
|
||||||
{
|
{
|
||||||
botToUpdate.experience.reward.min = rawBotData.Info.Settings.Experience;
|
botToUpdate.experience.reward ??= new();
|
||||||
botToUpdate.experience.reward.max = rawBotData.Info.Settings.Experience;
|
|
||||||
|
botToUpdate.experience.reward.TryGetValue(rawBotData.Info.Settings.BotDifficulty, out var minMaxValues);
|
||||||
|
if (minMaxValues is null)
|
||||||
|
{
|
||||||
|
botToUpdate.experience.reward.Add(rawBotData.Info.Settings.BotDifficulty, new(rawBotData.Info.Settings.Experience, rawBotData.Info.Settings.Experience));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
minMaxValues.min = Math.Min(minMaxValues.min, rawBotData.Info.Settings.Experience);
|
||||||
|
minMaxValues.max = Math.Max(minMaxValues.max, rawBotData.Info.Settings.Experience);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AddVoice(Bot bot, Datum rawBot)
|
private static void AddVoice(Bot bot, Datum rawBot)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user