Advertisement
omgfrost

token druid profile (universal)

Apr 6th, 2020
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using SmartBot.Database;
  5. using SmartBot.Plugins.API;
  6.  
  7. /* Explanation on profiles :
  8. *
  9. * All the values defined in profiles are percentage modifiers, it means that it will affect base profile's default values.
  10. *
  11. * Modifiers values can be set within the range [-10000 ; 10000] (negative modifier has the opposite effect)
  12. * You can specify targets for the non-global modifiers, these target specific modifers will be added on top of global modifier + modifier for the card (without target)
  13. *
  14. * Total modifier applied = Global Modifier + Targetless modifier + Target specific modifier
  15. *
  16. *
  17. * GlobalDrawModifier ---> Modifier applied to card draw value
  18. * GlobalWeaponsAttackModifier ---> Modifier applied to the value of weapons attacks, the higher it ism the less likely the AI will be to attack with weapons
  19. *
  20. * GlobalCastSpellsModifier ---> Modifier applied to all spells no matter what they are. The higher is the modifier, the less likely the AI will be to play spells
  21. * GlobalCastMinionsModifier ---> Modifier applied to all minions no matter what they are. The higher is the modifier, the less likely the AI will be to play minions
  22. *
  23. * GlobalAggroModifier ---> Modifier applied to enemy's health value, the higher it is, the more aggressive will be the AI
  24. * GlobalDefenseModifier ---> Modifier applied to friendly's health value, the higher it is, the more hp conservative will be the AI
  25. *
  26. * CastSpellsModifiers ---> You can set individual modifiers to each spells, the higher is the modifier, the less likely the AI will be to play the spell
  27. * CastMinionsModifiers ---> You can set individual modifiers to each minions, the higher is the modifier, the less likely the AI will be to play the minion
  28. * CastHeroPowerModifier ---> Modifier applied to the heropower, the higher is the modifier, the less likely the AI will be to play it
  29. *
  30. * WeaponsAttackModifiers ---> Modifier applied to the weapons attacks, the higher is the modifier, the less likely the AI will be to attack with it
  31. *
  32. * OnBoardFriendlyMinionsValuesModifiers ---> Modifier applied to friendly minions on board. The higher is the modifier, the more the AI will be conservative with it.
  33. * OnBoardBoardEnemyMinionsModifiers ---> Modifier applied to enemy minions on board. The higher is the modifier, the more the AI will consider it as a priority target.
  34. *
  35. */
  36.  
  37.  
  38. namespace SmartBotProfiles
  39. {
  40. [Serializable]
  41. public class TreantDruid : Profile
  42. {
  43. private const Card.Cards SteadyShot = Card.Cards.DS1h_292;
  44. private const Card.Cards Shapeshift = Card.Cards.CS2_017;
  45. private const Card.Cards LifeTap = Card.Cards.CS2_056;
  46. private const Card.Cards Fireblast = Card.Cards.CS2_034;
  47. private const Card.Cards Reinforce = Card.Cards.CS2_101;
  48. private const Card.Cards ArmorUp = Card.Cards.CS2_102;
  49. private const Card.Cards LesserHeal = Card.Cards.CS1h_001;
  50. private const Card.Cards DaggerMastery = Card.Cards.CS2_083b;
  51. private const Card.Cards Squirrel = Card.Cards.DAL_354t;
  52. private const Card.Cards Albatross = Card.Cards.DRG_071t;
  53. private const Card.Cards Skyvateer = Card.Cards.YOD_016;
  54. private const Card.Cards KronxDragonhoof = Card.Cards.DRG_099;
  55. private const Card.Cards RisingWinds2 = Card.Cards.YOD_001ts;
  56. private const Card.Cards LotiFull = Card.Cards.TRL_343et1;
  57. private const Card.Cards RenotheRelicologist = Card.Cards.ULD_238;
  58.  
  59.  
  60.  
  61. private Board _board;
  62. private List<Card.Cards> Treants = new List<Card.Cards>()
  63. {
  64. Card.Cards.DAL_256t2,
  65. Card.Cards.EX1_573t,
  66. Card.Cards.DRG_311t,
  67. Card.Cards.EX1_158t,
  68. Card.Cards.GIL_663t,
  69. Card.Cards.FB_Champs_EX1_tk9,
  70. Card.Cards.FP1_019t,
  71. Card.Cards.EX1_tk9,
  72. Card.Cards.ULD_137t,
  73. };
  74.  
  75. private readonly Dictionary<Card.Cards, int> _heroPowersPriorityTable = new Dictionary<Card.Cards, int>
  76. {
  77. {SteadyShot, 8},
  78. {Shapeshift, 7},
  79. {LifeTap, 6},
  80. {Fireblast, 5},
  81. {Reinforce, 4},
  82. {ArmorUp, 3},
  83. {LesserHeal, 2},
  84. {DaggerMastery, 1}
  85. };
  86.  
  87. public ProfileParameters GetParameters(Board board)
  88. {
  89. _board = board;
  90. var p = new ProfileParameters(BaseProfile.Rush) { DiscoverSimulationValueThresholdPercent = 10 };
  91.  
  92. //case Card.Cards.NEW1_021: //Doomsayer
  93. // if (minion.IsFriend == false && minion.IsSilenced == false)
  94. // GlobalValueModifier += 1000;
  95. // break;
  96. //Don't do anything if Doomsayer is on board
  97. //if ((board.HasCardOnBoard(Cards.Doomsayer)))
  98. // {
  99. // p.GlobalAggroModifier.Value = -1000;
  100. // }
  101. // if (board.HasCardInHand(Cards.BattleRage) && (board.SecretEnemy) && (board.EnemyClass == Card.CClass.MAGE))
  102. //{
  103. // pp.CastSpellsModifiers.AddOrUpdate(Cards.InnerRage, new Modifier(-50));
  104. //}
  105. //else //increased conservation value of inner rage
  106. //{
  107. // pp.CastSpellsModifiers.AddOrUpdate(Cards.InnerRage, new Modifier(150));
  108. //}
  109. //Seems global modifier with below command, affect only when weapon is equipped;
  110. //if (_board.SecretEnemy) && _board.EnemyClass == Card.CClass.MAGE) && _board.EnemyClass == Card.CClass.HUNTER))
  111. //{
  112. // p.GlobalAggroModifier.Value = -35;
  113. //}
  114.  
  115. //Enemy minions
  116. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.DwarvenSharpshooter, new Modifier(130));
  117. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.ArchmageVargoth, new Modifier(80));
  118. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.PrimordialExplorer, new Modifier(175));
  119. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.SandhoofWaterbearer, new Modifier(145));
  120. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.SN1PSN4P, new Modifier(410));
  121. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.EscapedManasaber, new Modifier(235));
  122. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.EVILMiscreant, new Modifier(80));
  123. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.AzureExplorer, new Modifier(80));
  124. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Kalecgos, new Modifier(80));
  125. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Dragonbane, new Modifier(190));
  126. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Vessina, new Modifier(80));
  127. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.CatrinaMuerte, new Modifier(144));
  128. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Skyvateer, new Modifier(201));
  129. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.KronxDragonhoof, new Modifier(170));
  130. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.StargazerLuna, new Modifier(110));
  131. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.HistoryBuff, new Modifier(200));
  132. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(LotiFull, new Modifier(95));
  133. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(RenotheRelicologist, new Modifier(200));
  134. //Serpent Ward TRL_057
  135. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.SerpentWard, new Modifier(260));
  136. //Skybarge
  137. //p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Card.DRG_023, new Modifier(80));
  138. //Kael'thas Sunstrider
  139. //p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Card.BT_255, new Modifier(80));
  140. //focus Temple Berserker with 1 hp
  141. if (board.MinionEnemy.Any(c => (c.Template.Id == Cards.TempleBerserker) && (c.CurrentHealth == 1)))
  142. {
  143. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.TempleBerserker, new Modifier(150));
  144. }
  145.  
  146. //On board friendly minions
  147. p.OnBoardFriendlyMinionsValuesModifiers.AddOrUpdate(Cards.Mulchmuncher, new Modifier(100));
  148. //p.OnBoardFriendlyMinionsValuesModifiers.AddOrUpdate(Cards.HenchClanHogsteed, new Modifier(-300));
  149. //p.GlobalDefenseModifier = 10000;
  150.  
  151. //Cast minions
  152. //Squirrel
  153. //p.CastMinionsModifiers.AddOrUpdate(Card.Cards.DAL_354t, new Modifier(900));
  154. //Faceless Corruptor waiting for Squirrel and Albatross (DRG_071t)
  155. if (board.HasCardInHand(Cards.FacelessCorruptor) && board.HasCardInDeck(Cards.FacelessCorruptor))
  156. {
  157. p.CastMinionsModifiers.AddOrUpdate(Squirrel, new Modifier(195));
  158. p.CastMinionsModifiers.AddOrUpdate(Albatross, new Modifier(195));
  159. }
  160. else
  161. {
  162. p.CastMinionsModifiers.AddOrUpdate(Squirrel, new Modifier(180));
  163. }
  164.  
  165. p.CastMinionsModifiers.AddOrUpdate(Cards.Dendrologist, new Modifier(60));
  166. if (!HasTreantOnBoard())
  167. {
  168. p.CastMinionsModifiers.AddOrUpdate(Cards.Dendrologist, new Modifier(299));
  169. }
  170.  
  171. p.CastMinionsModifiers.AddOrUpdate(Cards.BadLuckAlbatross, new Modifier(-199));
  172. p.CastMinionsModifiers.AddOrUpdate(Cards.GardenGnome, new Modifier(-40));
  173.  
  174.  
  175. if (_board.MaxMana == 1 && _board.Hand.Any(card => card.Template.Id == Cards.Treenforcements))
  176. {
  177. p.CastMinionsModifiers.AddOrUpdate(Cards.Shrubadier, new Modifier(85));
  178. }
  179. if (_board.MaxMana == 1)
  180. {
  181. p.CastMinionsModifiers.AddOrUpdate(Cards.Shrubadier, new Modifier(100));
  182. }
  183. //try keep Mulchmuncher when no Enemy Board
  184. if (board.MinionEnemy.Count == 0)
  185. {
  186. p.CastMinionsModifiers.AddOrUpdate(Cards.Mulchmuncher, new Modifier(700));
  187. }
  188. else
  189. {
  190. p.CastMinionsModifiers.AddOrUpdate(Cards.Mulchmuncher, new Modifier(449));
  191. }
  192. //Goblin lackey
  193. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_739, new Modifier(152));
  194. //Ethereal lackey
  195. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_741, new Modifier(152));
  196. //Faceless lackey
  197. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_613, new Modifier(152));
  198. //Kobold lackey
  199. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_614, new Modifier(152));
  200. //Witchy lackey
  201. p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_615, new Modifier(152));
  202.  
  203. //Cast spells
  204. var hasOneOrLessManaAeroponics = board.Hand.Any(card => card.Template.Id == Cards.Aeroponics && card.CurrentCost <= 3);
  205. p.CastSpellsModifiers.AddOrUpdate(Cards.Aeroponics, new Modifier(-40));
  206. if (board.ManaAvailable <= 3 && hasOneOrLessManaAeroponics)
  207. {
  208. p.CastSpellsModifiers.AddOrUpdate(Cards.Aeroponics, new Modifier(-200));
  209. }
  210.  
  211. p.CastSpellsModifiers.AddOrUpdate(Cards.PoweroftheWild, new Modifier(150));
  212. p.CastSpellsModifiers.AddOrUpdate(Cards.Overflow, new Modifier(80));
  213. p.CastSpellsModifiers.AddOrUpdate(Cards.RisingWinds, new Modifier(-65));
  214. //RisingWinds Second Spell
  215. p.CastSpellsModifiers.AddOrUpdate(RisingWinds2, new Modifier(-125));
  216. p.CastSpellsModifiers.AddOrUpdate(Cards.BiologyProject, new Modifier(600));
  217. //Secure the Deck
  218. p.CastSpellsModifiers.AddOrUpdate(Card.Cards.DRG_317, new Modifier(600));
  219. p.CastSpellsModifiers.AddOrUpdate(Cards.WorthyExpedition, new Modifier(-800));
  220. p.CastSpellsModifiers.AddOrUpdate(Cards.Treenforcements, new Modifier(30));
  221. p.CastSpellsModifiers.AddOrUpdate(Cards.ForceofNature, new Modifier(20));
  222. p.CastSpellsModifiers.AddOrUpdate(Cards.TheForestsAid, new Modifier(25));
  223. p.CastSpellsModifiers.AddOrUpdate(Cards.WitchwoodApple, new Modifier(-250));
  224. //p.CastSpellModifiers.AddOrUpdate(Cards.Landscaping, new Modifier(1000));
  225.  
  226. //if (_board.HasCardInHand(Cards.Dendrologist))
  227. //{
  228. // p.CastSpellsModifiers.AddOrUpdate(Cards.Treenforcements, new Modifier(-70));
  229. //}
  230.  
  231.  
  232. //p.CastSpellsModifiers.AddOrUpdate(Card.Cards.DRG_311a, new Modifier(0));
  233. p.CastSpellsModifiers.AddOrUpdate(Card.Cards.DRG_311a, new Modifier(-110));
  234. p.CastSpellsModifiers.AddOrUpdate(Card.Cards.DRG_311b, new Modifier(-110));
  235.  
  236.  
  237. return p;
  238. }
  239.  
  240. public bool HasTreantOnBoard()
  241. {
  242. return _board.MinionFriend.Any(card => card.Template.Name == "Treant");
  243. }
  244.  
  245. public Card.Cards SirFinleyChoice(List<Card.Cards> choices)
  246. {
  247. var filteredTable = _heroPowersPriorityTable.Where(x => choices.Contains(x.Key)).ToList();
  248. return filteredTable.First(x => x.Value == filteredTable.Max(y => y.Value)).Key;
  249. }
  250.  
  251. public Card.Cards KazakusChoice(List<Card.Cards> choices)
  252. {
  253. return choices[0];
  254. }
  255. }
  256. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement