From 55ca5ebbbea9834a02e498520c9919c075e99ba6 Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 1 Sep 2021 14:41:21 +0100 Subject: [PATCH] Add missing tagilla difficultiy settings --- Common/Models/BotType.cs | 27 ++++++++++--------- Generator/Helpers/DifficultyHelper.cs | 4 +-- .../Models/Output/Difficulty/Difficulty.cs | 16 ++++++++++- Generator/Program.cs | 1 + 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/Common/Models/BotType.cs b/Common/Models/BotType.cs index 7aef3ca..e9c3ad3 100644 --- a/Common/Models/BotType.cs +++ b/Common/Models/BotType.cs @@ -10,18 +10,19 @@ bosskilla = 6, bosskojaniy = 7, bosssanitar = 8, - bossstormtrooper = 9, - followerbully = 10, - followergluharassault = 11, - followergluharscout = 12, - followergluharsecurity = 13, - followergluharsnipe = 14, - followerkojaniy = 15, - followersanitar = 16, - followerstormtrooper = 17, - cursedassault = 18, - sectantpriest = 19, - sectantwarrior = 20, - usec = 21 + bosstagilla = 9, + bossstormtrooper = 10, + followerbully = 11, + followergluharassault = 12, + followergluharscout = 13, + followergluharsecurity = 14, + followergluharsnipe = 15, + followerkojaniy = 16, + followersanitar = 17, + followerstormtrooper = 18, + cursedassault = 19, + sectantpriest = 20, + sectantwarrior = 21, + usec = 22 } } diff --git a/Generator/Helpers/DifficultyHelper.cs b/Generator/Helpers/DifficultyHelper.cs index d6c1eb7..ecb0b91 100644 --- a/Generator/Helpers/DifficultyHelper.cs +++ b/Generator/Helpers/DifficultyHelper.cs @@ -16,7 +16,7 @@ namespace Generator.Helpers // Read bot setting files from assets folder that match this bots type // Save into dictionary with difficulty as key var difficultySettingsJsons = new Dictionary(); - foreach (var path in difficultyFilePaths.Where(x=>x.Contains($"_{bot.botType.ToString()}", System.StringComparison.InvariantCultureIgnoreCase))) + foreach (var path in difficultyFilePaths.Where(x=>x.Contains($"_{bot.botType}", System.StringComparison.InvariantCultureIgnoreCase))) { var json = File.ReadAllText(path); var serialisedObject = JsonConvert.DeserializeObject(json); @@ -46,7 +46,7 @@ namespace Generator.Helpers // Split path into parts and find the last part (filename) // Split filename and take the first part (difficulty, easy/normal etc) var splitPath = path.Split("\\"); - return splitPath.Last().Split("_").First(); + return splitPath.Last().Split("_")[0]; } private static void SaveSettingsIntoBotFile(Bot bot, string difficulty, DifficultySettings settings) diff --git a/Generator/Models/Output/Difficulty/Difficulty.cs b/Generator/Models/Output/Difficulty/Difficulty.cs index 38eb3a7..00a6c03 100644 --- a/Generator/Models/Output/Difficulty/Difficulty.cs +++ b/Generator/Models/Output/Difficulty/Difficulty.cs @@ -852,7 +852,7 @@ public class Boss { - public Boss(double bOSS_DIST_TO_WARNING, double bOSS_DIST_TO_WARNING_SQRT, double bOSS_DIST_TO_WARNING_OUT, double bOSS_DIST_TO_WARNING_OUT_SQRT, double bOSS_DIST_TO_SHOOT, double bOSS_DIST_TO_SHOOT_SQRT, double cHANCE_TO_SEND_GRENADE_100, double mAX_DIST_COVER_BOSS, double mAX_DIST_COVER_BOSS_SQRT, double mAX_DIST_DECIDER_TO_SEND, double mAX_DIST_DECIDER_TO_SEND_SQRT, double tIME_AFTER_LOSE, double tIME_AFTER_LOSE_DELTA, int pERSONS_SEND, double dELTA_SEARCH_TIME, bool cOVER_TO_SEND, double wAIT_NO_ATTACK_SAVAGE, double cHANCE_USE_RESERVE_PATROL_100, double kILLA_Y_DELTA_TO_BE_ENEMY_BOSS, double kILLA_DITANCE_TO_BE_ENEMY_BOSS, double kILLA_START_SEARCH_SEC, double kILLA_CONTUTION_TIME, double kILLA_CLOSE_ATTACK_DIST, double kILLA_MIDDLE_ATTACK_DIST, double kILLA_LARGE_ATTACK_DIST, double kILLA_SEARCH_METERS, double kILLA_DEF_DIST_SQRT, double kILLA_SEARCH_SEC_STOP_AFTER_COMING, double kILLA_DIST_TO_GO_TO_SUPPRESS, double kILLA_AFTER_GRENADE_SUPPRESS_DELAY, int kILLA_CLOSEATTACK_TIMES, double kILLA_CLOSEATTACK_DELAY, double kILLA_HOLD_DELAY, int kILLA_BULLET_TO_RELOAD, bool sHALL_WARN, double kOJANIY_DIST_WHEN_READY, double kOJANIY_DIST_TO_BE_ENEMY, double kOJANIY_MIN_DIST_TO_LOOT, double kOJANIY_MIN_DIST_TO_LOOT_SQRT, double kOJANIY_DIST_ENEMY_TOO_CLOSE, double kOJANIY_MANY_ENEMIES_COEF, int kILLA_ENEMIES_TO_ATTACK, double kILLA_ONE_IS_CLOSE, double kILLA_TRIGGER_DOWN_DELAY, double kILLA_WAIT_IN_COVER_COEF) + public Boss(double bOSS_DIST_TO_WARNING, double bOSS_DIST_TO_WARNING_SQRT, double bOSS_DIST_TO_WARNING_OUT, double bOSS_DIST_TO_WARNING_OUT_SQRT, double bOSS_DIST_TO_SHOOT, double bOSS_DIST_TO_SHOOT_SQRT, double cHANCE_TO_SEND_GRENADE_100, double mAX_DIST_COVER_BOSS, double mAX_DIST_COVER_BOSS_SQRT, double mAX_DIST_DECIDER_TO_SEND, double mAX_DIST_DECIDER_TO_SEND_SQRT, double tIME_AFTER_LOSE, double tIME_AFTER_LOSE_DELTA, int pERSONS_SEND, double dELTA_SEARCH_TIME, bool cOVER_TO_SEND, double wAIT_NO_ATTACK_SAVAGE, double cHANCE_USE_RESERVE_PATROL_100, double kILLA_Y_DELTA_TO_BE_ENEMY_BOSS, double kILLA_DITANCE_TO_BE_ENEMY_BOSS, double kILLA_START_SEARCH_SEC, double kILLA_CONTUTION_TIME, double kILLA_CLOSE_ATTACK_DIST, double kILLA_MIDDLE_ATTACK_DIST, double kILLA_LARGE_ATTACK_DIST, double kILLA_SEARCH_METERS, double kILLA_DEF_DIST_SQRT, double kILLA_SEARCH_SEC_STOP_AFTER_COMING, double kILLA_DIST_TO_GO_TO_SUPPRESS, double kILLA_AFTER_GRENADE_SUPPRESS_DELAY, int kILLA_CLOSEATTACK_TIMES, double kILLA_CLOSEATTACK_DELAY, double kILLA_HOLD_DELAY, int kILLA_BULLET_TO_RELOAD, bool sHALL_WARN, double kOJANIY_DIST_WHEN_READY, double kOJANIY_DIST_TO_BE_ENEMY, double kOJANIY_MIN_DIST_TO_LOOT, double kOJANIY_MIN_DIST_TO_LOOT_SQRT, double kOJANIY_DIST_ENEMY_TOO_CLOSE, double kOJANIY_MANY_ENEMIES_COEF, int kILLA_ENEMIES_TO_ATTACK, double kILLA_ONE_IS_CLOSE, double kILLA_TRIGGER_DOWN_DELAY, double kILLA_WAIT_IN_COVER_COEF, double tAGILLA_MELEE_CHANCE_RELOAD, double tAGILLA_MELEE_CHANCE_INTERACTION, double tAGILLA_MELEE_CHANCE_INVENTORY, double tAGILLA_MELEE_CHANCE_MEDS, double tAGILLA_MELEE_CHANCE_FORCED, double eFFECT_REGENERATION_PER_MIN, bool eFFECT_PAINKILLER) { BOSS_DIST_TO_WARNING = bOSS_DIST_TO_WARNING; BOSS_DIST_TO_WARNING_SQRT = bOSS_DIST_TO_WARNING_SQRT; @@ -899,6 +899,13 @@ KILLA_ONE_IS_CLOSE = kILLA_ONE_IS_CLOSE; KILLA_TRIGGER_DOWN_DELAY = kILLA_TRIGGER_DOWN_DELAY; KILLA_WAIT_IN_COVER_COEF = kILLA_WAIT_IN_COVER_COEF; + TAGILLA_MELEE_CHANCE_RELOAD = tAGILLA_MELEE_CHANCE_RELOAD; + TAGILLA_MELEE_CHANCE_INTERACTION = tAGILLA_MELEE_CHANCE_INTERACTION; + TAGILLA_MELEE_CHANCE_INVENTORY = tAGILLA_MELEE_CHANCE_INVENTORY; + TAGILLA_MELEE_CHANCE_MEDS = tAGILLA_MELEE_CHANCE_MEDS; + TAGILLA_MELEE_CHANCE_FORCED = tAGILLA_MELEE_CHANCE_FORCED; + EFFECT_REGENERATION_PER_MIN = eFFECT_REGENERATION_PER_MIN; + EFFECT_PAINKILLER = eFFECT_PAINKILLER; } public double BOSS_DIST_TO_WARNING { get; set; } @@ -946,6 +953,13 @@ public double KILLA_ONE_IS_CLOSE { get; set; } public double KILLA_TRIGGER_DOWN_DELAY { get; set; } public double KILLA_WAIT_IN_COVER_COEF { get; set; } + public double TAGILLA_MELEE_CHANCE_RELOAD { get; set; } + public double TAGILLA_MELEE_CHANCE_INTERACTION { get; set; } + public double TAGILLA_MELEE_CHANCE_INVENTORY { get; set; } + public double TAGILLA_MELEE_CHANCE_MEDS { get; set; } + public double TAGILLA_MELEE_CHANCE_FORCED { get; set; } + public double EFFECT_REGENERATION_PER_MIN { get; set; } + public bool EFFECT_PAINKILLER { get; set; } } public class Core diff --git a/Generator/Program.cs b/Generator/Program.cs index 22c0bea..4d9733a 100644 --- a/Generator/Program.cs +++ b/Generator/Program.cs @@ -17,6 +17,7 @@ namespace Generator "bosskilla", "bosskojaniy", "bosssanitar", + "bosstagilla", //"bossstormtrooper", "followerbully",