界面上无法识别,提示是
[Unidentified card ID :DAL_010]
[Unidentified card ID :DAL_415]
搜索getcardid,在所有的相关函数处设置断点,看会进入哪里的断点
发现是进入了namespace Triton.Game.Mapping
[Attribute38("EntityBase")]
public class EntityBase : MonoClass
这个类
public string GetCardId() { return base.method_13("GetCardId", Array.Empty<object>()); }
namespace Triton.Game
public class HSCard
public string Id { get { return this.Entity_0.GetCardId(); } }
namespace HREngine.Bots
public class Silverfish
// HREngine.Bots.Silverfish // Token: 0x06000048 RID: 72 RVA: 0x0000A16C File Offset: 0x0000836C private void getDecks() { Dictionary<string, int> tmpDeck = new Dictionary<string, int>(this.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); this.turnDeck.Clear(); this.noDuplicates = false; List<HSCard> allcards = TritonHs.GetAllCards(); int allcardscount = allcards.Count; for (int i = 0; i < allcardscount; i++) { HSCard entity = allcards[i]; if (entity.Id != null && !(entity.Id == "")) { if (CardDB.Instance.cardIdstringToEnum(entity.Id) == CardDB.cardIDEnum.UNG_116t) { this.ownMinionsCost0 = true; } if (entity.GetZone() == 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)) { Dictionary<CardDB.cardIDEnum, int> dictionary; CardDB.cardIDEnum key; (dictionary = og)[key = cide] = dictionary[key] + 1; } else { og.Add(cide, 1); } } else if (entity.GetTag(GAME_TAG.CONTROLLER) == enemycontroler) { if (eg.ContainsKey(cide)) { Dictionary<CardDB.cardIDEnum, int> dictionary; CardDB.cardIDEnum key; (dictionary = eg)[key = cide] = dictionary[key] + 1; } else { eg.Add(cide, 1); } } if (cide == CardDB.cardIDEnum.UNG_067t1) { this.ownCrystalCore = 5; } } string entityId = entity.Id; TAG_ZONE entZone = entity.GetZone(); if (i < 30) { if (entityId != "") { if (entZone != TAG_ZONE.DECK) { if (tmpDeck.ContainsKey(entityId)) { Dictionary<string, int> dictionary2; string key2; (dictionary2 = tmpDeck)[key2 = entityId] = dictionary2[key2] - 1; } } } } else if (i >= 60 && entity.ControllerId == owncontroler) { if (this.extraDeck.ContainsKey(i)) { if (entityId != "" && entityId != this.extraDeck[i].id) { this.extraDeck[i].setId(entityId); } if (entZone == TAG_ZONE.DECK != this.extraDeck[i].isindeck) { this.extraDeck[i].setisindeck(entZone == TAG_ZONE.DECK); } } else if (entZone == TAG_ZONE.DECK) { this.extraDeck.Add(i, new Silverfish.extraCard(entityId, true)); } } } } Action a = Ai.Instance.bestmove; foreach (KeyValuePair<int, Silverfish.extraCard> c in this.extraDeck) { if (c.Value.isindeck) { string entityId = c.Value.id; if (entityId == "") { if (a != null) { actionEnum actionType = a.actionType; if (actionType == actionEnum.playcard) { CardDB.cardIDEnum cardIDEnum = a.card.card.cardIDenum; if (cardIDEnum <= CardDB.cardIDEnum.LOE_019t) { if (cardIDEnum == CardDB.cardIDEnum.BRM_007) { goto IL_42B; } if (cardIDEnum != CardDB.cardIDEnum.LOE_002) { if (cardIDEnum == CardDB.cardIDEnum.LOE_019t) { entityId = "LOE_019t2"; } } else { entityId = "LOE_002t"; } } else if (cardIDEnum != CardDB.cardIDEnum.LOE_079) { if (cardIDEnum == CardDB.cardIDEnum.LOE_104) { goto IL_42B; } if (cardIDEnum == CardDB.cardIDEnum.LOE_110) { entityId = "LOE_110t"; } } else { entityId = "LOE_019t"; } goto IL_485; IL_42B: if (a.target != null) { entityId = a.target.handcard.card.cardIDenum.ToString(); } } IL_485:; } if (entityId == "") { Dictionary<CardDB.cardIDEnum, int> oldCardsOut = Probabilitymaker.Instance.enemyCardsOut; foreach (KeyValuePair<CardDB.cardIDEnum, int> tmp in eg) { if (!oldCardsOut.ContainsKey(tmp.Key) || tmp.Value != oldCardsOut[tmp.Key]) { CardDB.cardIDEnum cardIDEnum = tmp.Key; if (cardIDEnum != CardDB.cardIDEnum.AT_035) { if (cardIDEnum != CardDB.cardIDEnum.GVG_031) { if (cardIDEnum == CardDB.cardIDEnum.LOE_111) { entityId = "LOE_111"; } } else { entityId = "aiextra1"; } } else { entityId = "AT_035t"; } } } if (entityId == "" && this.lastpf != null) { int num = 0; foreach (Minion j in this.enemyMinions) { if (j.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_056) { num++; } } if (num > 0) { foreach (Minion j in this.lastpf.enemyMinions) { if (j.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_056) { num--; } } } if (num > 0) { entityId = "GVG_056t"; } else { num = 0; foreach (Minion j in this.lastpf.ownMinions) { if (j.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_035) { num++; } } if (num > 0) { foreach (Minion j in this.ownMinions) { if (j.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_035) { num--; } } } if (num > 0) { entityId = "GVG_035"; } } } } if (entityId == "") { entityId = "aiextra1"; } } c.Value.setId(entityId); CardDB.cardIDEnum ce = CardDB.Instance.cardIdstringToEnum(entityId); if (this.turnDeck.ContainsKey(ce)) { Dictionary<CardDB.cardIDEnum, int> dictionary; CardDB.cardIDEnum key; (dictionary = this.turnDeck)[key = ce] = dictionary[key] + 1; } else { this.turnDeck.Add(ce, 1); } } } foreach (KeyValuePair<string, int> c2 in tmpDeck) { if (c2.Value >= 1) { CardDB.cardIDEnum ce = CardDB.Instance.cardIdstringToEnum(c2.Key); if (ce != CardDB.cardIDEnum.None) { if (this.turnDeck.ContainsKey(ce)) { Dictionary<CardDB.cardIDEnum, int> dictionary; CardDB.cardIDEnum key; (dictionary = this.turnDeck)[key = ce] = dictionary[key] + c2.Value; } else { this.turnDeck.Add(ce, c2.Value); } } } } Probabilitymaker.Instance.setOwnCardsOut(og); Probabilitymaker.Instance.setEnemyCardsOut(eg); bool isTurnStart = false; if (Ai.Instance.nextMoveGuess.mana == -100) { isTurnStart = true; Ai.Instance.updateTwoTurnSim(); } Probabilitymaker.Instance.setGraveYard(graveYard, isTurnStart); if (this.startDeck.Count != 0) { this.noDuplicates = true; foreach (int i in this.turnDeck.Values) { if (i > 1) { this.noDuplicates = false; break; } } } }
// HREngine.Bots.Silverfish // Token: 0x06000044 RID: 68 RVA: 0x00008154 File Offset: 0x00006354 public bool updateEverything(Behavior botbase, int numcal, out bool sleepRetry) { this.needSleep = false; this.updateBehaveString(botbase); this.ownPlayerController = TritonHs.OurHero.ControllerId; Hrtprozis.Instance.clearAllRecalc(); Handmanager.Instance.clearAllRecalc(); this.getHerostuff(); this.getMinions(); this.getHandcards(); this.getDecks(); Hrtprozis.Instance.updateTurnDeck(this.turnDeck, this.noDuplicates); Hrtprozis.Instance.setOwnPlayer(this.ownPlayerController); Handmanager.Instance.setOwnPlayer(this.ownPlayerController); this.numOptionPlayedThisTurn = 0; this.numOptionPlayedThisTurn += this.cardsPlayedThisTurn + this.ownHero.numAttacksThisTurn; foreach (Minion i in this.ownMinions) { if (i.Hp >= 1) { this.numOptionPlayedThisTurn += i.numAttacksThisTurn; } } List<HSCard> list = TritonHs.GetCards(CardZone.Graveyard, true); foreach (GraveYardItem gi in Probabilitymaker.Instance.turngraveyard) { if (gi.own) { foreach (HSCard entiti in list) { if (gi.entity == entiti.EntityId) { this.numOptionPlayedThisTurn += entiti.NumAttackThisTurn; break; } } } } Hrtprozis.Instance.updatePlayer(this.ownMaxMana, this.currentMana, this.cardsPlayedThisTurn, this.numMinionsPlayedThisTurn, this.numOptionPlayedThisTurn, this.ueberladung, this.lockedMana, TritonHs.OurHero.EntityId, TritonHs.EnemyHero.EntityId); Hrtprozis.Instance.updateSecretStuff(this.ownSecretList, this.enemySecretList.Count); Hrtprozis.Instance.updateHero(this.ownWeapon, this.heroname, this.heroAbility, this.ownAbilityisReady, this.ownHeroPowerCost, this.ownHero, 10); Hrtprozis.Instance.updateHero(this.enemyWeapon, this.enemyHeroname, this.enemyAbility, false, this.enemyHeroPowerCost, this.enemyHero, this.enemyMaxMana); Questmanager.Instance.updatePlayedMobs(this.gTurnStep); Hrtprozis.Instance.updateMinions(this.ownMinions, this.enemyMinions); Hrtprozis.Instance.updateLurkersDB(this.LurkersDB); Handmanager.Instance.setHandcards(this.handCards, this.anzcards, this.enemyAnzCards); Hrtprozis.Instance.updateFatigueStats(this.ownDecksize, this.ownHeroFatigue, this.enemyDecksize, this.enemyHeroFatigue); Hrtprozis.Instance.updateJadeGolemsInfo(GameState.Get().GetFriendlySidePlayer().GetTag(GAME_TAG.JADE_GOLEM), GameState.Get().GetOpposingSidePlayer().GetTag(GAME_TAG.JADE_GOLEM)); Hrtprozis.Instance.updateTurnInfo(this.gTurn, this.gTurnStep); this.updateCThunInfobyCThun(); Hrtprozis.Instance.updateCThunInfo(this.anzOgOwnCThunAngrBonus, this.anzOgOwnCThunHpBonus, this.anzOgOwnCThunTaunt); Hrtprozis.Instance.updateCrystalCore(this.ownCrystalCore); Hrtprozis.Instance.updateOwnMinionsInDeckCost0(this.ownMinionsCost0); Probabilitymaker.Instance.setEnemySecretGuesses(this.enemySecretList); sleepRetry = this.needSleep; bool result; if (sleepRetry && numcal == 0) { result = false; } else { if (!Hrtprozis.Instance.setGameRule) { RulesEngine.Instance.setCardIdRulesGame(this.ownHero.cardClass, this.enemyHero.cardClass); Hrtprozis.Instance.setGameRule = true; } Playfield p = new Playfield(); p.enemyCardsOut = new Dictionary<CardDB.cardIDEnum, int>(Probabilitymaker.Instance.enemyCardsOut); if (this.lastpf != null) { if (this.lastpf.isEqualf(p)) { return false; } if (p.gTurnStep > 0 && Ai.Instance.nextMoveGuess.ownMinions.Count == p.ownMinions.Count) { if (Ai.Instance.nextMoveGuess.ownHero.Ready != p.ownHero.Ready && !p.ownHero.Ready) { sleepRetry = true; Helpfunctions.Instance.ErrorLog("[AI] Hero ready = " + p.ownHero.Ready + ". Attempting recover...."); Ai.Instance.nextMoveGuess = new Playfield { mana = -100 }; return false; } for (int j = 0; j < p.ownMinions.Count; j++) { if (Ai.Instance.nextMoveGuess.ownMinions[j].Ready != p.ownMinions[j].Ready && !p.ownMinions[j].Ready) { sleepRetry = true; Helpfunctions.Instance.ErrorLog(string.Concat(new object[] { "[AI] Minion ready = ", p.ownMinions[j].Ready, " (", p.ownMinions[j].entitiyID, " ", p.ownMinions[j].handcard.card.cardIDenum, " ", p.ownMinions[j].name, "). Attempting recover...." })); Ai.Instance.nextMoveGuess = new Playfield { mana = -100 }; return false; } } } Probabilitymaker.Instance.updateSecretList(p, this.lastpf); this.lastpf = p; } else { this.lastpf = p; } p = new Playfield(); Helpfunctions.Instance.ErrorLog("calculating stuff... " + DateTime.Now.ToString("HH:mm:ss.ffff")); using (TritonHs.Memory.ReleaseFrame(true)) { this.printstuff(); Ai.Instance.dosomethingclever(botbase); } Helpfunctions.Instance.ErrorLog("calculating ended! " + DateTime.Now.ToString("HH:mm:ss.ffff")); if (this.sttngs.printRules > 0) { string[] rulesStr = Ai.Instance.bestplay.rulesUsed.Split(new char[] { ‘@‘ }); if (rulesStr.Count<string>() > 0 && rulesStr[0] != "") { Helpfunctions.Instance.ErrorLog("ruleWeight " + Ai.Instance.bestplay.ruleWeight * -1); foreach (string rs in rulesStr) { if (!(rs == "")) { Helpfunctions.Instance.ErrorLog("rule: " + rs); } } } } result = true; } return result; }
// HREngine.Bots.Silverfish// Token: 0x06000048 RID: 72 RVA: 0x0000A16C File Offset: 0x0000836Cprivate void getDecks(){Dictionary<string, int> tmpDeck = new Dictionary<string, int>(this.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);this.turnDeck.Clear();this.noDuplicates = false;List<HSCard> allcards = TritonHs.GetAllCards();int allcardscount = allcards.Count;for (int i = 0; i < allcardscount; i++){HSCard entity = allcards[i];if (entity.Id != null && !(entity.Id == "")){if (CardDB.Instance.cardIdstringToEnum(entity.Id) == CardDB.cardIDEnum.UNG_116t){this.ownMinionsCost0 = true;}if (entity.GetZone() == 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)){Dictionary<CardDB.cardIDEnum, int> dictionary;CardDB.cardIDEnum key;(dictionary = og)[key = cide] = dictionary[key] + 1;}else{og.Add(cide, 1);}}else if (entity.GetTag(GAME_TAG.CONTROLLER) == enemycontroler){if (eg.ContainsKey(cide)){Dictionary<CardDB.cardIDEnum, int> dictionary;CardDB.cardIDEnum key;(dictionary = eg)[key = cide] = dictionary[key] + 1;}else{eg.Add(cide, 1);}}if (cide == CardDB.cardIDEnum.UNG_067t1){this.ownCrystalCore = 5;}}string entityId = entity.Id;TAG_ZONE entZone = entity.GetZone();if (i < 30){if (entityId != ""){if (entZone != TAG_ZONE.DECK){if (tmpDeck.ContainsKey(entityId)){Dictionary<string, int> dictionary2;string key2;(dictionary2 = tmpDeck)[key2 = entityId] = dictionary2[key2] - 1;}}}}else if (i >= 60 && entity.ControllerId == owncontroler){if (this.extraDeck.ContainsKey(i)){if (entityId != "" && entityId != this.extraDeck[i].id){this.extraDeck[i].setId(entityId);}if (entZone == TAG_ZONE.DECK != this.extraDeck[i].isindeck){this.extraDeck[i].setisindeck(entZone == TAG_ZONE.DECK);}}else if (entZone == TAG_ZONE.DECK){this.extraDeck.Add(i, new Silverfish.extraCard(entityId, true));}}}}Action a = Ai.Instance.bestmove;foreach (KeyValuePair<int, Silverfish.extraCard> c in this.extraDeck){if (c.Value.isindeck){string entityId = c.Value.id;if (entityId == ""){if (a != null){actionEnum actionType = a.actionType;if (actionType == actionEnum.playcard){CardDB.cardIDEnum cardIDEnum = a.card.card.cardIDenum;if (cardIDEnum <= CardDB.cardIDEnum.LOE_019t){if (cardIDEnum == CardDB.cardIDEnum.BRM_007){goto IL_42B;}if (cardIDEnum != CardDB.cardIDEnum.LOE_002){if (cardIDEnum == CardDB.cardIDEnum.LOE_019t){entityId = "LOE_019t2";}}else{entityId = "LOE_002t";}}else if (cardIDEnum != CardDB.cardIDEnum.LOE_079){if (cardIDEnum == CardDB.cardIDEnum.LOE_104){goto IL_42B;}if (cardIDEnum == CardDB.cardIDEnum.LOE_110){entityId = "LOE_110t";}}else{entityId = "LOE_019t";}goto IL_485;IL_42B:if (a.target != null){entityId = a.target.handcard.card.cardIDenum.ToString();}}IL_485:;}if (entityId == ""){Dictionary<CardDB.cardIDEnum, int> oldCardsOut = Probabilitymaker.Instance.enemyCardsOut;foreach (KeyValuePair<CardDB.cardIDEnum, int> tmp in eg){if (!oldCardsOut.ContainsKey(tmp.Key) || tmp.Value != oldCardsOut[tmp.Key]){CardDB.cardIDEnum cardIDEnum = tmp.Key;if (cardIDEnum != CardDB.cardIDEnum.AT_035){if (cardIDEnum != CardDB.cardIDEnum.GVG_031){if (cardIDEnum == CardDB.cardIDEnum.LOE_111){entityId = "LOE_111";}}else{entityId = "aiextra1";}}else{entityId = "AT_035t";}}}if (entityId == "" && this.lastpf != null){int num = 0;foreach (Minion j in this.enemyMinions){if (j.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_056){num++;}}if (num > 0){foreach (Minion j in this.lastpf.enemyMinions){if (j.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_056){num--;}}}if (num > 0){entityId = "GVG_056t";}else{num = 0;foreach (Minion j in this.lastpf.ownMinions){if (j.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_035){num++;}}if (num > 0){foreach (Minion j in this.ownMinions){if (j.handcard.card.cardIDenum == CardDB.cardIDEnum.GVG_035){num--;}}}if (num > 0){entityId = "GVG_035";}}}}if (entityId == ""){entityId = "aiextra1";}}c.Value.setId(entityId);CardDB.cardIDEnum ce = CardDB.Instance.cardIdstringToEnum(entityId);if (this.turnDeck.ContainsKey(ce)){Dictionary<CardDB.cardIDEnum, int> dictionary;CardDB.cardIDEnum key;(dictionary = this.turnDeck)[key = ce] = dictionary[key] + 1;}else{this.turnDeck.Add(ce, 1);}}}foreach (KeyValuePair<string, int> c2 in tmpDeck){if (c2.Value >= 1){CardDB.cardIDEnum ce = CardDB.Instance.cardIdstringToEnum(c2.Key);if (ce != CardDB.cardIDEnum.None){if (this.turnDeck.ContainsKey(ce)){Dictionary<CardDB.cardIDEnum, int> dictionary;CardDB.cardIDEnum key;(dictionary = this.turnDeck)[key = ce] = dictionary[key] + c2.Value;}else{this.turnDeck.Add(ce, c2.Value);}}}}Probabilitymaker.Instance.setOwnCardsOut(og);Probabilitymaker.Instance.setEnemyCardsOut(eg);bool isTurnStart = false;if (Ai.Instance.nextMoveGuess.mana == -100){isTurnStart = true;Ai.Instance.updateTwoTurnSim();}Probabilitymaker.Instance.setGraveYard(graveYard, isTurnStart);if (this.startDeck.Count != 0){this.noDuplicates = true;foreach (int i in this.turnDeck.Values){if (i > 1){this.noDuplicates = false;break;}}}}
原文:https://www.cnblogs.com/chucklu/p/11192069.html