Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using SmartBot.Database;
- using SmartBot.Plugins.API;
- /* Explanation on profiles :
- *
- * All the values defined in profiles are percentage modifiers, it means that it will affect base profile's default values.
- *
- * Modifiers values can be set within the range [-10000 ; 10000] (negative modifier has the opposite effect)
- * 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)
- *
- * Total modifier applied = Global Modifier + Targetless modifier + Target specific modifier
- *
- *
- * GlobalDrawModifier ---> Modifier applied to card draw value
- * GlobalWeaponsAttackModifier ---> Modifier applied to the value of weapons attacks, the higher it ism the less likely the AI will be to attack with weapons
- *
- * 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
- * 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
- *
- * GlobalAggroModifier ---> Modifier applied to enemy's health value, the higher it is, the more aggressive will be the AI
- * GlobalDefenseModifier ---> Modifier applied to friendly's health value, the higher it is, the more hp conservative will be the AI
- *
- * 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
- * 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
- * CastHeroPowerModifier ---> Modifier applied to the heropower, the higher is the modifier, the less likely the AI will be to play it
- *
- * WeaponsAttackModifiers ---> Modifier applied to the weapons attacks, the higher is the modifier, the less likely the AI will be to attack with it
- *
- * OnBoardFriendlyMinionsValuesModifiers ---> Modifier applied to friendly minions on board. The higher is the modifier, the more the AI will be conservative with it.
- * OnBoardBoardEnemyMinionsModifiers ---> Modifier applied to enemy minions on board. The higher is the modifier, the more the AI will consider it as a priority target.
- *
- */
- namespace SmartBotProfiles
- {
- [Serializable]
- public class TreantDruid : Profile
- {
- private const Card.Cards SteadyShot = Card.Cards.DS1h_292;
- private const Card.Cards Shapeshift = Card.Cards.CS2_017;
- private const Card.Cards LifeTap = Card.Cards.CS2_056;
- private const Card.Cards Fireblast = Card.Cards.CS2_034;
- private const Card.Cards Reinforce = Card.Cards.CS2_101;
- private const Card.Cards ArmorUp = Card.Cards.CS2_102;
- private const Card.Cards LesserHeal = Card.Cards.CS1h_001;
- private const Card.Cards DaggerMastery = Card.Cards.CS2_083b;
- private const Card.Cards Squirrel = Card.Cards.DAL_354t;
- private const Card.Cards Albatross = Card.Cards.DRG_071t;
- private const Card.Cards Skyvateer = Card.Cards.YOD_016;
- private const Card.Cards KronxDragonhoof = Card.Cards.DRG_099;
- private const Card.Cards RisingWinds2 = Card.Cards.YOD_001ts;
- private const Card.Cards LotiFull = Card.Cards.TRL_343et1;
- private const Card.Cards RenotheRelicologist = Card.Cards.ULD_238;
- private Board _board;
- private List<Card.Cards> Treants = new List<Card.Cards>()
- {
- Card.Cards.DAL_256t2,
- Card.Cards.EX1_573t,
- Card.Cards.DRG_311t,
- Card.Cards.EX1_158t,
- Card.Cards.GIL_663t,
- Card.Cards.FB_Champs_EX1_tk9,
- Card.Cards.FP1_019t,
- Card.Cards.EX1_tk9,
- Card.Cards.ULD_137t,
- };
- private readonly Dictionary<Card.Cards, int> _heroPowersPriorityTable = new Dictionary<Card.Cards, int>
- {
- {SteadyShot, 8},
- {Shapeshift, 7},
- {LifeTap, 6},
- {Fireblast, 5},
- {Reinforce, 4},
- {ArmorUp, 3},
- {LesserHeal, 2},
- {DaggerMastery, 1}
- };
- public ProfileParameters GetParameters(Board board)
- {
- _board = board;
- var p = new ProfileParameters(BaseProfile.Rush) { DiscoverSimulationValueThresholdPercent = 10 };
- //case Card.Cards.NEW1_021: //Doomsayer
- // if (minion.IsFriend == false && minion.IsSilenced == false)
- // GlobalValueModifier += 1000;
- // break;
- //Don't do anything if Doomsayer is on board
- //if ((board.HasCardOnBoard(Cards.Doomsayer)))
- // {
- // p.GlobalAggroModifier.Value = -1000;
- // }
- // if (board.HasCardInHand(Cards.BattleRage) && (board.SecretEnemy) && (board.EnemyClass == Card.CClass.MAGE))
- //{
- // pp.CastSpellsModifiers.AddOrUpdate(Cards.InnerRage, new Modifier(-50));
- //}
- //else //increased conservation value of inner rage
- //{
- // pp.CastSpellsModifiers.AddOrUpdate(Cards.InnerRage, new Modifier(150));
- //}
- //Seems global modifier with below command, affect only when weapon is equipped;
- //if (_board.SecretEnemy) && _board.EnemyClass == Card.CClass.MAGE) && _board.EnemyClass == Card.CClass.HUNTER))
- //{
- // p.GlobalAggroModifier.Value = -35;
- //}
- //Enemy minions
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.DwarvenSharpshooter, new Modifier(130));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.ArchmageVargoth, new Modifier(80));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.PrimordialExplorer, new Modifier(175));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.SandhoofWaterbearer, new Modifier(145));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.SN1PSN4P, new Modifier(410));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.EscapedManasaber, new Modifier(235));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.EVILMiscreant, new Modifier(80));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.AzureExplorer, new Modifier(80));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Kalecgos, new Modifier(80));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Dragonbane, new Modifier(190));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Vessina, new Modifier(80));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.CatrinaMuerte, new Modifier(144));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Skyvateer, new Modifier(201));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.KronxDragonhoof, new Modifier(170));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.StargazerLuna, new Modifier(110));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.HistoryBuff, new Modifier(200));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(LotiFull, new Modifier(95));
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(RenotheRelicologist, new Modifier(200));
- //Serpent Ward TRL_057
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.SerpentWard, new Modifier(260));
- //Skybarge
- //p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Card.DRG_023, new Modifier(80));
- //Kael'thas Sunstrider
- //p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.Card.BT_255, new Modifier(80));
- //focus Temple Berserker with 1 hp
- if (board.MinionEnemy.Any(c => (c.Template.Id == Cards.TempleBerserker) && (c.CurrentHealth == 1)))
- {
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Cards.TempleBerserker, new Modifier(150));
- }
- //On board friendly minions
- p.OnBoardFriendlyMinionsValuesModifiers.AddOrUpdate(Cards.Mulchmuncher, new Modifier(100));
- //p.OnBoardFriendlyMinionsValuesModifiers.AddOrUpdate(Cards.HenchClanHogsteed, new Modifier(-300));
- //p.GlobalDefenseModifier = 10000;
- //Cast minions
- //Squirrel
- //p.CastMinionsModifiers.AddOrUpdate(Card.Cards.DAL_354t, new Modifier(900));
- //Faceless Corruptor waiting for Squirrel and Albatross (DRG_071t)
- if (board.HasCardInHand(Cards.FacelessCorruptor) && board.HasCardInDeck(Cards.FacelessCorruptor))
- {
- p.CastMinionsModifiers.AddOrUpdate(Squirrel, new Modifier(195));
- p.CastMinionsModifiers.AddOrUpdate(Albatross, new Modifier(195));
- }
- else
- {
- p.CastMinionsModifiers.AddOrUpdate(Squirrel, new Modifier(180));
- }
- p.CastMinionsModifiers.AddOrUpdate(Cards.Dendrologist, new Modifier(60));
- if (!HasTreantOnBoard())
- {
- p.CastMinionsModifiers.AddOrUpdate(Cards.Dendrologist, new Modifier(299));
- }
- p.CastMinionsModifiers.AddOrUpdate(Cards.BadLuckAlbatross, new Modifier(-199));
- p.CastMinionsModifiers.AddOrUpdate(Cards.GardenGnome, new Modifier(-40));
- if (_board.MaxMana == 1 && _board.Hand.Any(card => card.Template.Id == Cards.Treenforcements))
- {
- p.CastMinionsModifiers.AddOrUpdate(Cards.Shrubadier, new Modifier(85));
- }
- if (_board.MaxMana == 1)
- {
- p.CastMinionsModifiers.AddOrUpdate(Cards.Shrubadier, new Modifier(100));
- }
- //try keep Mulchmuncher when no Enemy Board
- if (board.MinionEnemy.Count == 0)
- {
- p.CastMinionsModifiers.AddOrUpdate(Cards.Mulchmuncher, new Modifier(700));
- }
- else
- {
- p.CastMinionsModifiers.AddOrUpdate(Cards.Mulchmuncher, new Modifier(449));
- }
- //Goblin lackey
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_739, new Modifier(152));
- //Ethereal lackey
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_741, new Modifier(152));
- //Faceless lackey
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_613, new Modifier(152));
- //Kobold lackey
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_614, new Modifier(152));
- //Witchy lackey
- p.OnBoardBoardEnemyMinionsModifiers.AddOrUpdate(Card.Cards.DAL_615, new Modifier(152));
- //Cast spells
- var hasOneOrLessManaAeroponics = board.Hand.Any(card => card.Template.Id == Cards.Aeroponics && card.CurrentCost <= 3);
- p.CastSpellsModifiers.AddOrUpdate(Cards.Aeroponics, new Modifier(-40));
- if (board.ManaAvailable <= 3 && hasOneOrLessManaAeroponics)
- {
- p.CastSpellsModifiers.AddOrUpdate(Cards.Aeroponics, new Modifier(-200));
- }
- p.CastSpellsModifiers.AddOrUpdate(Cards.PoweroftheWild, new Modifier(150));
- p.CastSpellsModifiers.AddOrUpdate(Cards.Overflow, new Modifier(80));
- p.CastSpellsModifiers.AddOrUpdate(Cards.RisingWinds, new Modifier(-65));
- //RisingWinds Second Spell
- p.CastSpellsModifiers.AddOrUpdate(RisingWinds2, new Modifier(-125));
- p.CastSpellsModifiers.AddOrUpdate(Cards.BiologyProject, new Modifier(600));
- //Secure the Deck
- p.CastSpellsModifiers.AddOrUpdate(Card.Cards.DRG_317, new Modifier(600));
- p.CastSpellsModifiers.AddOrUpdate(Cards.WorthyExpedition, new Modifier(-800));
- p.CastSpellsModifiers.AddOrUpdate(Cards.Treenforcements, new Modifier(30));
- p.CastSpellsModifiers.AddOrUpdate(Cards.ForceofNature, new Modifier(20));
- p.CastSpellsModifiers.AddOrUpdate(Cards.TheForestsAid, new Modifier(25));
- p.CastSpellsModifiers.AddOrUpdate(Cards.WitchwoodApple, new Modifier(-250));
- //p.CastSpellModifiers.AddOrUpdate(Cards.Landscaping, new Modifier(1000));
- //if (_board.HasCardInHand(Cards.Dendrologist))
- //{
- // p.CastSpellsModifiers.AddOrUpdate(Cards.Treenforcements, new Modifier(-70));
- //}
- //p.CastSpellsModifiers.AddOrUpdate(Card.Cards.DRG_311a, new Modifier(0));
- p.CastSpellsModifiers.AddOrUpdate(Card.Cards.DRG_311a, new Modifier(-110));
- p.CastSpellsModifiers.AddOrUpdate(Card.Cards.DRG_311b, new Modifier(-110));
- return p;
- }
- public bool HasTreantOnBoard()
- {
- return _board.MinionFriend.Any(card => card.Template.Name == "Treant");
- }
- public Card.Cards SirFinleyChoice(List<Card.Cards> choices)
- {
- var filteredTable = _heroPowersPriorityTable.Where(x => choices.Contains(x.Key)).ToList();
- return filteredTable.First(x => x.Value == filteredTable.Max(y => y.Value)).Key;
- }
- public Card.Cards KazakusChoice(List<Card.Cards> choices)
- {
- return choices[0];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement