HearthBuddy 召唤随从的问题
生活随笔
收集整理的這篇文章主要介紹了
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);}?
轉載于:https://www.cnblogs.com/chucklu/p/11440291.html
總結
以上是生活随笔為你收集整理的HearthBuddy 召唤随从的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 安卓开发上传相册图片成功上传拍照图片失败
- 下一篇: 材料科学基础学习指导-吕宇鹏-名词和术语