• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Mulligan neeed Help

    Discussion in 'Hearthbuddy Support' started by Akkordeon12, May 31, 2017.

    1. Akkordeon12

      Akkordeon12 New Member

      Joined:
      May 17, 2016
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      1
      Hey Guys.

      I Made an Behavior for my pirate warrior.
      Set up "rushpirate" as DefaultBehavior in HB

      Why does the _mulligan dont work?

      Can anyone help me pls ty
      greetings

      Behaviorrushpirate.cs :

      namespace HREngine.Bots
      {
      public class Behaviorrushpirate : Behavior
      {
      public override string BehaviorName() { return "rushpirate"; }


      PenalityManager penman = PenalityManager.Instance;

      public override float getPlayfieldValue(Playfield p)
      {
      if (p.value >= -2000000) return p.value;
      int retval = 0;
      retval -= p.evaluatePenality;
      retval += p.owncards.Count * 3;
      retval += p.ownQuest.questProgress * 10;

      retval += p.ownHero.Hp + p.ownHero.armor;
      retval += -(p.enemyHero.Hp + p.enemyHero.armor);

      retval += p.ownMaxMana * 15 - p.enemyMaxMana * 15;

      if (p.ownHeroPowerAllowedQuantity != p.enemyHeroPowerAllowedQuantity)
      {
      if (p.ownHeroPowerAllowedQuantity > p.enemyHeroPowerAllowedQuantity) retval += 1;
      else retval -= 4;
      }

      if (p.ownWeaponAttack >= 1)
      {
      retval += p.ownWeaponAttack * p.ownWeaponDurability;
      }

      if (!p.enemyHero.frozen)
      {
      retval -= p.enemyWeaponDurability * p.enemyWeaponAttack;
      }
      else
      {
      if (p.enemyHeroName != HeroEnum.mage && p.enemyHeroName != HeroEnum.priest)
      {
      retval += 11;
      }
      }

      //RR card draw value depending on the turn and distance to lethal
      //RR if lethal is close, carddraw value is increased
      if (p.lethalMissing() <= 5) //RR
      {
      retval += p.owncarddraw * 100;
      }
      if (p.ownMaxMana < 4)
      {
      retval += p.owncarddraw * 2;
      }
      else
      {
      retval += p.owncarddraw * 5;
      }
      retval += p.owncarddraw * 5;
      if (p.owncarddraw + 1 >= p.enemycarddraw) retval -= p.enemycarddraw * 7;
      else retval -= (p.owncarddraw + 1) * 7 + (p.enemycarddraw - p.owncarddraw - 1) * 12;

      bool useAbili = false;
      int usecoin = 0;
      foreach (Action a in p.playactions)
      {
      if (a.actionType == actionEnum.attackWithHero && p.enemyHero.Hp <= p.attackFaceHP) retval++;
      if (a.actionType == actionEnum.useHeroPower) useAbili = true;
      if (p.ownHeroName == HeroEnum.warrior && a.actionType == actionEnum.attackWithHero && useAbili) retval -= 1;
      //if (a.actionType == actionEnum.useHeroPower && a.card.card.name == CardDB.cardName.lesserheal && (!a.target.own)) retval -= 5;
      if (a.actionType != actionEnum.playcard) continue;
      if (a.card.card.name == CardDB.cardName.thecoin) usecoin++;
      if (a.card.card.name == CardDB.cardName.innervate) usecoin += 2;
      }
      if (usecoin > 0)
      {
      if (useAbili && p.ownMaxMana <= 2) retval -= 40;
      retval -= 5 * p.manaTurnEnd;
      if (p.manaTurnEnd + usecoin > 10) retval -= 5 * usecoin;
      }
      if (p.manaTurnEnd >= 2 && !useAbili && p.ownAbilityReady)
      {
      switch (p.ownHeroAblility.card.name)
      {
      case CardDB.cardName.heal: goto case CardDB.cardName.lesserheal;
      case CardDB.cardName.lesserheal:
      bool wereTarget = false;
      if (p.ownHero.Hp < p.ownHero.maxHp) wereTarget = true;
      if (!wereTarget)
      {
      foreach (Minion m in p.ownMinions)
      {
      if (m.wounded) { wereTarget = true; break; }
      }
      }
      if (wereTarget && !(p.anzOwnAuchenaiSoulpriest > 0 || p.embracetheshadow > 0)) retval -= 10;
      break;
      case CardDB.cardName.poisoneddaggers: goto case CardDB.cardName.daggermastery;
      case CardDB.cardName.daggermastery:
      if (!(p.ownWeaponDurability > 1 || p.ownWeaponAttack > 1)) retval -= 10;
      break;
      case CardDB.cardName.totemicslam: goto case CardDB.cardName.totemiccall;
      case CardDB.cardName.totemiccall:
      if (p.ownMinions.Count < 7) retval -= 10;
      else retval -= 3;
      break;
      case CardDB.cardName.thetidalhand: goto case CardDB.cardName.reinforce;
      case CardDB.cardName.thesilverhand: goto case CardDB.cardName.reinforce;
      case CardDB.cardName.reinforce:
      if (p.ownMinions.Count < 7) retval -= 10;
      else retval -= 3;
      break;
      case CardDB.cardName.soultap:
      if (p.owncards.Count < 10 && p.ownDeckSize > 0) retval -= 10;
      break;
      case CardDB.cardName.lifetap:
      if (p.owncards.Count < 10 && p.ownDeckSize > 0)
      {
      retval -= 10;
      if (p.ownHero.immune) retval -= 5;
      }
      break;
      default:
      retval -= 10;
      break;
      }
      }
      //if (usecoin && p.mana >= 1) retval -= 20;

      foreach (Minion m in p.ownMinions)
      {
      retval += m.Hp * 1;
      retval += m.Angr * 2;
      retval += m.handcard.card.rarity;
      if (m.windfury) retval += m.Angr;
      if (m.taunt) retval += 1;
      if (!m.taunt && m.stealth && m.handcard.card.isSpecialMinion && !m.silenced) retval += 20;
      if (m.handcard.card.name == CardDB.cardName.silverhandrecruit && m.Angr == 1 && m.Hp == 1) retval -= 5;
      if (p.ownMinions.Count > 1 && (m.handcard.card.name == CardDB.cardName.direwolfalpha || m.handcard.card.name == CardDB.cardName.flametonguetotem || m.handcard.card.name == CardDB.cardName.stormwindchampion || m.handcard.card.name == CardDB.cardName.raidleader || m.handcard.card.name == CardDB.cardName.fallenhero)) retval += 10;
      if (m.handcard.card.name == CardDB.cardName.nerubianegg)
      {
      if (m.Angr >= 1) retval += 2;
      if ((!m.taunt && m.Angr == 0) && (m.divineshild || m.maxHp > 2)) retval -= 10;
      }
      retval += m.synergy;
      }

      foreach (Handmanager.Handcard hc in p.owncards)
      {
      if (hc.card.type == CardDB.cardtype.MOB)
      {
      retval += hc.addattack + hc.addHp + hc.elemPoweredUp;
      }
      }

      int tmp = 0;
      foreach (Minion m in p.enemyMinions)
      {
      tmp = this.getEnemyMinionValue(m, p);
      }
      if (p.enemyMinions.Count == 1) tmp /= 2;
      retval -= tmp;

      retval -= p.enemySecretCount;
      retval -= p.lostDamage;//damage which was to high (like killing a 2/1 with an 3/3 -> => lostdamage =2
      retval -= p.lostWeaponDamage;
      if (p.ownMinions.Count == 0) retval -= 20;
      if (p.enemyMinions.Count >= 4) retval -= 20;
      if (p.enemyHero.Hp <= 0) retval = 10000;

      retval += p.anzOwnExtraAngrHp - p.anzEnemyExtraAngrHp / 2;
      //soulfire etc
      int deletecardsAtLast = 0;
      foreach (Action a in p.playactions)
      {
      if (a.actionType != actionEnum.playcard) continue;
      if (a.card.card.name == CardDB.cardName.soulfire || a.card.card.name == CardDB.cardName.doomguard || a.card.card.name == CardDB.cardName.succubus) deletecardsAtLast = 1;
      if (deletecardsAtLast == 1 && !(a.card.card.name == CardDB.cardName.soulfire || a.card.card.name == CardDB.cardName.doomguard || a.card.card.name == CardDB.cardName.succubus)) retval -= 20;
      }
      if (p.enemyHero.Hp >= 1 && p.guessingHeroHP <= 0)
      {
      if (p.turnCounter < 2) retval += p.owncarddraw * 500;
      retval -= 1000;
      }
      if (p.ownHero.Hp <= 0) retval -= 10000;

      p.value = retval;
      return retval;
      }

      public override int getEnemyMinionValue(Minion m, Playfield p)
      {
      int retval = 0;
      if (p.enemyMinions.Count >= 4 || m.taunt || (m.handcard.card.targetPriority >= 1 && !m.silenced) || m.Angr >= 5)
      {
      retval += m.Hp;
      if (!m.frozen && !(m.cantAttack && m.name != CardDB.cardName.argentwatchman))
      {
      retval += m.Angr * 2;
      if (m.windfury) retval += 2 * m.Angr;
      }
      if (m.taunt) retval += 5;
      if (m.divineshild) retval += m.Angr;
      if (m.frozen) retval -= 1; // because its bad for enemy :D
      if (m.poisonous) retval += 4;
      if (m.handcard.card.isSpecialMinion) retval += m.handcard.card.rarity;
      }

      retval += m.synergy;
      if (m.handcard.card.targetPriority >= 1 && !m.silenced) retval += m.handcard.card.targetPriority;
      if (m.Angr >= 4) retval += 20;
      if (m.Angr >= 7) retval += 50;
      if (m.name == CardDB.cardName.nerubianegg && m.Angr <= 3 && !m.taunt) retval = 0;
      return retval;
      }


      }

      }


      upload_2017-5-31_18-4-33.png
       

      Attached Files:

    2. Coolmaster

      Coolmaster Member

      Joined:
      Aug 16, 2013
      Messages:
      709
      Likes Received:
      3
      Trophy Points:
      18
      Akkordeon12, please zip your rushpirate folder and attach here.
       
    3. Akkordeon12

      Akkordeon12 New Member

      Joined:
      May 17, 2016
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      1
      Thanks Coolmaster.

      is attached
       

      Attached Files:

    4. Coolmaster

      Coolmaster Member

      Joined:
      Aug 16, 2013
      Messages:
      709
      Likes Received:
      3
      Trophy Points:
      18
      Akkordeon12, specify your class.
      For example:
      OG_315;None;None;Discard:2;/
      EX1_604;None;None;Discard:2;/

      replace with:
      OG_315;warrior;None;Discard:2;/
      EX1_604;warrior;None;Discard:2;/

      ps: you can use Visual Mulligan Editor for test your rules
       
      Last edited: May 31, 2017
    5. Akkordeon12

      Akkordeon12 New Member

      Joined:
      May 17, 2016
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      1
      hi, Coolmaster.

      i Createt it with Visual Mulligan
       
    6. Coolmaster

      Coolmaster Member

      Joined:
      Aug 16, 2013
      Messages:
      709
      Likes Received:
      3
      Trophy Points:
      18
      When you make a rule through the Visual Mulligan Editor, specify your Hero's class in the first step (for example Mage-All or Warrior-Hunter). Also it is should to use a Mana-rule correctly.
      In any case, you can test all your rules right in the Visual Mulligan Editor (there is a instructional video)
       
    7. Akkordeon12

      Akkordeon12 New Member

      Joined:
      May 17, 2016
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      1
      Thanks problem solved. Coolmaster what decks are u playing with to climb ladder?
       
    8. Sicarium

      Sicarium New Member

      Joined:
      Apr 9, 2017
      Messages:
      5
      Likes Received:
      0
      Trophy Points:
      1
      can you let me your zip fixed?
       
    9. Sicarium

      Sicarium New Member

      Joined:
      Apr 9, 2017
      Messages:
      5
      Likes Received:
      0
      Trophy Points:
      1
      and where i should put it?
       

    Share This Page