getDecks(); 设置

 private void getDecks()
{
Dictionary<string, int> tmpDeck = new Dictionary<string, int>(startDeck);
List<GraveYardItem> graveYard = new List<GraveYardItem>();
Dictionary<CardDB.cardIDEnum, int> og = new Dictionary<CardDB.cardIDEnum, int>();
Dictionary<CardDB.cardIDEnum, int> eg = new Dictionary<CardDB.cardIDEnum, int>();
int owncontroler = TritonHs.OurHero.GetTag(GAME_TAG.CONTROLLER);
int enemycontroler = TritonHs.EnemyHero.GetTag(GAME_TAG.CONTROLLER);
turnDeck.Clear();
noDuplicates = false; List<HSCard> allcards = TritonHs.GetAllCards(); int allcardscount = allcards.Count;
for (int i = ; i < allcardscount; i++)
{
HSCard entity = allcards[i];
if (entity.Id == null || entity.Id == "") continue; if (CardDB.Instance.cardIdstringToEnum(entity.Id) == CardDB.cardIDEnum.UNG_116t) ownMinionsCost0 = true; if (entity.GetZone() == Triton.Game.Mapping.TAG_ZONE.GRAVEYARD)
{
CardDB.cardIDEnum cide = CardDB.Instance.cardIdstringToEnum(entity.Id);
GraveYardItem gyi = new GraveYardItem(cide, entity.EntityId, entity.GetTag(GAME_TAG.CONTROLLER) == owncontroler);
graveYard.Add(gyi); if (entity.GetTag(GAME_TAG.CONTROLLER) == owncontroler)
{
if (og.ContainsKey(cide)) og[cide]++;
else og.Add(cide, );
}
else if (entity.GetTag(GAME_TAG.CONTROLLER) == enemycontroler)
{
if (eg.ContainsKey(cide)) eg[cide]++;
else eg.Add(cide, );
}
if (cide == CardDB.cardIDEnum.UNG_067t1) ownCrystalCore = ;
} string entityId = entity.Id;
Triton.Game.Mapping.TAG_ZONE entZone = entity.GetZone();
if (i < )
{
if (entityId != "")
{
if (entZone == Triton.Game.Mapping.TAG_ZONE.DECK) continue;
if (tmpDeck.ContainsKey(entityId)) tmpDeck[entityId]--;
}
}
else if (i >= && entity.ControllerId == owncontroler)
{
if (extraDeck.ContainsKey(i))
{
if (entityId != "" && entityId != extraDeck[i].id) extraDeck[i].setId(entityId);
if ((entZone == Triton.Game.Mapping.TAG_ZONE.DECK) != extraDeck[i].isindeck) extraDeck[i].setisindeck(entZone == Triton.Game.Mapping.TAG_ZONE.DECK);
}
else if (entZone == Triton.Game.Mapping.TAG_ZONE.DECK)
{
extraDeck.Add(i, new extraCard(entityId, true));
}
}
} Action a = Ai.Instance.bestmove;
foreach (var c in extraDeck)
{
if (c.Value.isindeck == false) continue;
CardDB.cardIDEnum ce;
string entityId = c.Value.id;
if (entityId == "")
{
if (a != null)
{
switch (a.actionType)
{
case actionEnum.playcard:
switch (a.card.card.cardIDenum)
{
case CardDB.cardIDEnum.LOE_104: goto case CardDB.cardIDEnum.BRM_007;
case CardDB.cardIDEnum.BRM_007:
if (a.target != null) entityId = a.target.handcard.card.cardIDenum.ToString();
break;
case CardDB.cardIDEnum.LOE_002: entityId = "LOE_002t"; break;
case CardDB.cardIDEnum.LOE_079: entityId = "LOE_019t"; break;
case CardDB.cardIDEnum.LOE_019t: entityId = "LOE_019t2"; break;
case CardDB.cardIDEnum.LOE_110: entityId = "LOE_110t"; break;
}
break;
}
}
if (entityId == "")
{
var oldCardsOut = Probabilitymaker.Instance.enemyCardsOut;
foreach (var tmp in eg)
{
if (oldCardsOut.ContainsKey(tmp.Key) && tmp.Value == oldCardsOut[tmp.Key]) continue;
switch (tmp.Key)
{
case CardDB.cardIDEnum.AT_035: entityId = "AT_035t"; break;
case CardDB.cardIDEnum.GVG_031: entityId = "aiextra1"; break;
case CardDB.cardIDEnum.LOE_111: entityId = "LOE_111"; break;
}
}
if (entityId == "" && lastpf != null)
{
int num = ;
foreach (Minion m in this.enemyMinions)
{
if (m.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_056) num++;
}
if (num > )
{
foreach (Minion m in lastpf.enemyMinions)
{
if (m.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_056) num--;
}
}
if (num > ) entityId = "GVG_056t";
else
{
num = ;
foreach (Minion m in lastpf.ownMinions)
{
if (m.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_035) num++;
}
if (num > )
{
foreach (Minion m in this.ownMinions)
{
if (m.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_035) num--;
}
}
if (num > ) entityId = "GVG_035";
}
}
}
if (entityId == "") entityId = "aiextra1";
}
c.Value.setId(entityId);
ce = CardDB.Instance.cardIdstringToEnum(entityId);
if (turnDeck.ContainsKey(ce)) turnDeck[ce]++;
else turnDeck.Add(ce, );
}
foreach (var c in tmpDeck)
{
if (c.Value < ) continue;
CardDB.cardIDEnum ce = CardDB.Instance.cardIdstringToEnum(c.Key);
if (ce == CardDB.cardIDEnum.None) continue;
if (turnDeck.ContainsKey(ce)) turnDeck[ce] += c.Value;
else turnDeck.Add(ce, c.Value);
} Probabilitymaker.Instance.setOwnCardsOut(og);
Probabilitymaker.Instance.setEnemyCardsOut(eg);
bool isTurnStart = false;
if (Ai.Instance.nextMoveGuess.mana == -)
{
isTurnStart = true;
Ai.Instance.updateTwoTurnSim();
}
Probabilitymaker.Instance.setGraveYard(graveYard, isTurnStart); if (startDeck.Count == ) return;
noDuplicates = true;
foreach (int i in turnDeck.Values)
{
if (i > )
{
noDuplicates = false;
break;
}
}
}

最终的实现

https://github.com/ChuckHearthstone/SilverFish/blob/master/DefaultRoutine/Chuck.SilverFish/Helpers/EvenDeckHelper.cs

HearthBuddy炉石兄弟 格雷迈恩的更多相关文章

  1. HearthBuddy炉石兄弟 Method 'Entity.GetRace' not found.

    解决方案 namespace Triton.Game.Mapping{// Token: 0x020004A4 RID: 1188[Attribute38("Entity")]pu ...

  2. HearthBuddy炉石兄弟 如何调试ai

    Sepefeets's update to botmaker's Silverfish AI This AI is a Custom Class for Hearthranger and Hearth ...

  3. HearthBuddy炉石兄弟 Method 'CollectionDeckBoxVisual.IsValid' not found.

    [CollectionManagerScene_COLLECTION] An exception occurred when calling CacheCustomDecks: System.Miss ...

  4. 炉石兄弟 修复图腾师问题 by大神beebee102, 还有阴燃电鳗

    修复图腾师问题   beebee102 修复了先摇图腾再下图腾师的问题,另外加了阴燃电鳗的sim卡.在兄弟策略的模拟程序中测试了没问题,真机没有试过,麻烦吧友测试了回复一下.链接: [有效] http ...

  5. [.NET] ConfuserEx脱壳工具打包

    [.NET] ConfuserEx脱壳工具打包 ConfuserEx 1.0.0脱壳步骤        Written by 今夕何夕[W.B.L.E. TeAm] 1.先用UnconfuserEx把 ...

  6. Playfield 类方法的注释

    前言 本篇随笔的底包采用的是百度炉石兄弟吧20200109折腾版中自带的 routines 文件. 本次仅为绝大多数方法添加 xml 注释和简单解析,没有具体解析与重构. Playfield 类方法众 ...

  7. HearthBuddy卡组

    偶数萨 手打两天已上传说,各位加油  欧洲牧羊人 ### 火元素换艾雅# 职业:萨满祭司# 模式:狂野模式## 2x (2) 图腾魔像        # 2x (2) 大漩涡传送门   # 2x (2 ...

  8. HearthBuddy 第一次调试

    HearthBuddy https://www.jiligame.com/70639.html 解压缩包,打开hearthbuddy.exe直接运行就可以:不用替换mono.dll直接可用:不需要校验 ...

  9. angularjs $emit $on $broadcast 父子 兄弟之间传值

    父子之间 <div ng-controller="ParentCtrl"> <div ng-controller="ChildCtrl"> ...

随机推荐

  1. vs code 开发小程序会用到的插件

    主要介绍一下几个vscode插件,在vscode中搜索插件关键字点击安装即可. 1) vscode weapp api,  语法结构api; 2) minapp-vscode 3) vscode wx ...

  2. Swift Review总结一:从 Swift Style 开始

    最近凑了几个热心的小伙伴写一些Swift的新手demo(两周后应该能和大家见面了),我参与了review.于是借demo里的代码总结一下新手写Swift要注意的问题,尤其是从oc转到用swift写的开 ...

  3. Struts2自定义标签重写(转)

    TagSupport的学习 1 TagSupport与BodyTagSupport的区别 TagSupport与BodyTagSupport的区别主要是标签处理类是否需要与标签体交互,如果不需要交互的 ...

  4. java——多线程—启动线程

    继承Thread启动线程 package com.mycom.继承Thread启动线程; /** * * 继承Thread类启动线程的步骤 * 1.定义自定义线程类并继承Thread * 2.重写ru ...

  5. Java&Selenium&JS&AWT之那些难以点击到的按钮

    一.摘要 本篇博文的重点并不是简单的click()方法,而是要讲的是那些click()方法失效的时候的处理方式,其实做自动化久了我们都能发现研发的代码并不是都那么美丽,selenium支持的8种定位方 ...

  6. bash: hexo: command not found

    问题 很久没写博客了,今天用hexo新建文章时git报错: bash: hexo: command not found 解决办法 百度之后,将D:\WorkingSoftware\GithubBlog ...

  7. PAT乙级1037

    题目链接 https://pintia.cn/problem-sets/994805260223102976/problems/994805284923359232 题解 还算简单,就是模拟我们在生活 ...

  8. 从Excel中读取数据并批量写入MySQL数据库(基于MySQLdb)

    一.Excel内容如下,现在需要将Excel中的数据全部写入的MySQL数据库中: 二.连接MySQL的第三方库使用的是“MySQLdb”,代码如下: # -*- coding:utf-8 -*-im ...

  9. shell实现并发控制

    需求:并发检测1000台web服务器状态(或者并发为1000台web服务器分发文件等)如何用shell实现?                                              ...

  10. 《深入理解Java虚拟机》之(三、虚拟机性能监控与故障处理工具)

    一.JDK的命令行工具 1.jps:虚拟机进程状况工具 功能:可以列出正在运行的虚拟机进程,并显示虚拟机执行朱磊名称以及这些进程的本地虚拟机唯一ID. 2.jstat:虚拟机统计信息监控工具 Jsta ...