HearthBuddy summon problem entourage

The following code, in SilverFish \ SilverFish \ ai \ Playfield.cs file

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);

        }

 

Void Lord as an example

Voidlord
Nether Lord
{
"the Entity": {
"CardId,": "LOOT_368",

     "LocStringZhCn": "<b> sarcasm, Deathwhisper: </ b> \ n call with three 1/3 <b> sarcasm </ b> demon.",

    "LocStringEnUs": "[x]<b>Taunt</b>\n <b>Deathrattle:</b> Summon three\n1/3 Demons with <b>Taunt</b>.",

 

Analysis,

If the court has seven followers, then the void lord of death, only to summon an attendant.

If the court has six followers, then the void lord of death, we can only summon two followers.

If the field already has five or fewer followers, then the void lord of death, can summon three followers.

 

You need to add a comment

https://github.com/ChuckHearthBuddy/SilverFish/blob/master/SilverFish/cards/LOOT/Sim_LOOT_368.cs

/// <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,
        {falseoneMoreIsAllowed =bool)
            
            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);

        }

 

Guess you like

Origin www.cnblogs.com/chucklu/p/11440291.html