HearthBuddy 召唤随从的问题
Posted chucklu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HearthBuddy 召唤随从的问题相关的知识,希望对你有一定的参考价值。
代码如下,在SilverFish\SilverFish\ai\Playfield.cs文件中
public void callKid(CardDB.Card c, int zonepos, bool own, bool spawnKid = true, bool oneMoreIsAllowed = false) int allowed = 7; allowed += (oneMoreIsAllowed) ? 1 : 0; if (own) if (this.ownMinions.Count >= allowed) if (spawnKid) this.evaluatePenality += 10; else this.evaluatePenality += 20; return; else if (this.enemyMinions.Count >= allowed) if (spawnKid) this.evaluatePenality -= 10; else this.evaluatePenality -= 20; return; int mobplace = zonepos + 1; //create minion (+triggers) Handmanager.Handcard hc = new Handmanager.Handcard(c) entity = this.getNextEntity() ; Minion m = createNewMinion(hc, mobplace, own); //put it on battle field (+triggers) addMinionToBattlefield(m);
虚空领主为例子
Voidlord
虚空领主
"Entity":
"CardId": "LOOT_368",
"LocStringZhCn": "<b>嘲讽,亡语:</b>\n召唤三个1/3并具有<b>嘲讽</b>的恶魔。",
"LocStringEnUs": "[x]<b>Taunt</b>\n <b>Deathrattle:</b> Summon three\n1/3 Demons with <b>Taunt</b>.",
情况分析,
假如场上已经有7个随从了,那么虚空领主死亡,只能召唤1个随从。
假如场上已经有6个随从了,那么虚空领主死亡,只能召唤2个随从。
假如场上已经有5个或者更少的随从,那么虚空领主死亡,可以召唤3个随从。
虚空领主的simulation实现在github上
https://github.com/ChuckHearthBuddy/SilverFish/blob/master/SilverFish/cards/LOOT/Sim_LOOT_368.cs
另外,CallKid函数需要加上注释
/// <summary> /// /// </summary> /// <param name="card"></param> /// <param name="zonePosition"></param> /// <param name="own"></param> /// <param name="spawnKid">call kid triggered by another minion</param> /// <param name="oneMoreIsAllowed">for deathrattle minion to call kid(such as Voidlord)</param> public void CallKid(CardDB.Card card, int zonePosition, bool own, bool spawnKid = true, bool oneMoreIsAllowed = false) int allowed = 7; allowed += (oneMoreIsAllowed) ? 1 : 0; if (own) if (this.ownMinions.Count >= allowed) if (spawnKid) this.evaluatePenality += 10; else this.evaluatePenality += 20; return; else if (this.enemyMinions.Count >= allowed) if (spawnKid) this.evaluatePenality -= 10; else this.evaluatePenality -= 20; return; int mobplace = zonePosition + 1; //create minion (+triggers) Handmanager.Handcard hc = new Handmanager.Handcard(card) entity = this.getNextEntity() ; Minion m = createNewMinion(hc, mobplace, own); //put it on battle field (+triggers) addMinionToBattlefield(m);
以上是关于HearthBuddy 召唤随从的问题的主要内容,如果未能解决你的问题,请参考以下文章