本文整理汇总了C#中HREngine.Bots.Playfield.searchRandomMinion方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.searchRandomMinion方法的具体用法?C# Playfield.searchRandomMinion怎么用?C# Playfield.searchRandomMinion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HREngine.Bots.Playfield
的用法示例。
在下文中一共展示了Playfield.searchRandomMinion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onCardPlay
//Destroy 2 random enemy minions. Discard 2 random cards.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
if (p.isServer)
{
Minion choosen = p.getRandomMinionFromSide_SERVER(!ownplay, false);
if (choosen != null) p.minionGetDestroyed(choosen);
choosen = p.getRandomMinionFromSide_SERVER(!ownplay, false);
if (choosen != null) p.minionGetDestroyed(choosen);
p.discardRandomCard_SERVER(ownplay);
p.discardRandomCard_SERVER(ownplay);
return;
}
Minion choosen2 = p.searchRandomMinion(p.enemyMinions, Playfield.searchmode.searchLowestAttack);
if (choosen2 != null) p.minionGetDestroyed(choosen2);
choosen2 = p.searchRandomMinion(p.enemyMinions, Playfield.searchmode.searchLowestAttack);
if (choosen2 != null) p.minionGetDestroyed(choosen2);
p.disCardACard(ownplay);
p.disCardACard(ownplay);
}
示例2: onCardPlay
// Hero PowerDeal 8 damage to a random enemy.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
int dmg = 8;
if (ownplay)
{
if (p.doublepriest >= 1) dmg *= (2 * p.doublepriest);
if (p.enemyMinions.Count > 0)
{
target = p.searchRandomMinion(p.enemyMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
}
else
{
target = p.enemyHero;
}
}
else
{
if (p.enemydoublepriest >= 1) dmg *= (2 * p.enemydoublepriest);
if (p.ownMinions.Count > 0)
{
target = p.searchRandomMinion(p.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
}
else
{
target = p.ownHero;
}
}
p.minionGetDamageOrHeal(target, dmg);
}
示例3: onTurnEndsTrigger
// Can't Attack. At the end of your turn, deal 8 damage to a random enemy.
public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
{
if (triggerEffectMinion.own == turnEndOfOwner)
{
Minion target = new Minion();
if (turnEndOfOwner)
{
if (p.enemyMinions.Count > 0)
{
target = p.searchRandomMinion(p.enemyMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
}
else
{
target = p.enemyHero;
}
}
else
{
if (p.ownMinions.Count > 0)
{
target = p.searchRandomMinion(p.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
}
else
{
target = p.ownHero;
}
}
p.minionGetDamageOrHeal(target, 8);
triggerEffectMinion.stealth = false;
}
}
示例4: onCardPlay
// Give your weapon +3 Attack. Combo: Give a random friendly minion +3 Attack.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
if (p.isServer)
{
if (ownplay)
{
if (p.ownWeaponDurability >= 1)
{
p.ownWeaponAttack += 3;
p.minionGetBuffed(p.ownHero, 3, 0);
}
}
else
{
if (p.enemyWeaponDurability >= 1)
{
p.enemyWeaponAttack += 3;
p.minionGetBuffed(p.enemyHero, 3, 0);
}
}
if (p.cardsPlayedThisTurn >= 1 )
{
Minion choosen = p.getRandomMinionFromSide_SERVER(ownplay, false);
if (choosen != null) p.minionGetBuffed(choosen, 3, 0);
}
return;
}
if (ownplay)
{
if (p.ownWeaponDurability >= 1)
{
p.ownWeaponAttack += 3;
p.minionGetBuffed(p.ownHero, 3, 0);
}
if (p.cardsPlayedThisTurn >= 1 && p.ownMinions.Count >= 1)
{
p.minionGetBuffed(p.searchRandomMinion(p.ownMinions, Playfield.searchmode.searchLowestHP), 3, 0);
}
}
else
{
if (p.enemyWeaponDurability >= 1)
{
p.enemyWeaponAttack += 3;
p.minionGetBuffed(p.enemyHero, 3, 0);
}
if (p.cardsPlayedThisTurn >= 1 && p.enemyMinions.Count >= 1)
{
p.minionGetBuffed(p.searchRandomMinion(p.enemyMinions, Playfield.searchmode.searchHighestHP), 3, 0);
}
}
}
示例5: onTurnEndsTrigger
// At the end of your turn, give another friendly Mech +2/+2.
public override void onTurnEndsTrigger(Playfield p, Minion triggerEffectMinion, bool turnEndOfOwner)
{
if (turnEndOfOwner == triggerEffectMinion.own)
{
List<Minion> temp = (turnEndOfOwner) ? p.ownMinions : p.enemyMinions;
List<Minion> tempmech = new List<Minion>();
foreach (Minion m in temp)
{
if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL)
{
tempmech.Add(m);
}
}
if (tempmech.Count >= 1)
{
if (p.isServer)
{
int random = p.getRandomNumber_SERVER(0, tempmech.Count - 1);
p.minionGetBuffed(tempmech[random], 2, 2);
return;
}
p.minionGetBuffed(p.searchRandomMinion(tempmech, (triggerEffectMinion.own ? Playfield.searchmode.searchLowestHP : Playfield.searchmode.searchHighestHP)), 2, 2);
}
}
}
示例6: onCardPlay
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
p.equipWeapon(w, ownplay);
List<Minion> temp = (ownplay) ? p.ownMinions : p.enemyMinions;
if (temp.Count <= 0) return;
p.minionGetBuffed(p.searchRandomMinion(temp, (ownplay ? Playfield.searchmode.searchLowestHP : Playfield.searchmode.searchHighestHP)), 1, 0);
}
示例7: onCardPlay
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
p.equipWeapon(w, ownplay);
List<Minion> temp = (ownplay) ? p.ownMinions : p.enemyMinions;
if (temp.Count <= 0) return;
Minion m = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
m.divineshild = true;
m.taunt = true;
}
示例8: onMinionIsSummoned
// Whenever you summon a Pirate, deal 2 damage to a random enemy.
public override void onMinionIsSummoned(Playfield p, Minion triggerEffectMinion, Minion summonedMinion)
{
if (triggerEffectMinion.own == summonedMinion.own)
{
List<Minion> temp = (triggerEffectMinion.own) ? p.enemyMinions : p.ownMinions;
Minion m = p.searchRandomMinion(temp, Playfield.searchmode.searchHighestHP);
if (m == null) return;
p.minionGetDamageOrHeal(m, 2, true);
}
}
示例9: onCardPlay
// Destroy a random enemy minion. Combo: And your opponent's weapon.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
List<Minion> temp = (ownplay)? p.enemyMinions : p.ownMinions;
if (temp.Count >= 1)
{
p.minionGetDestroyed(p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP));
}
if (p.cardsPlayedThisTurn >= 1) p.lowerWeaponDurability(1000, !ownplay);
}
示例10: onCardIsGoingToBePlayed
//After you cast a spell, Freeze a random enemy character.
public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion, Minion target, int choice)
{
if (triggerEffectMinion.own == wasOwnCard && c.type == CardDB.cardtype.SPELL)
{
Minion target2 = null;
List<Minion> temp = (wasOwnCard) ? p.enemyMinions : p.ownMinions;
if (temp.Count > 0) target2 = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
if (target2 == null) target2 = (wasOwnCard) ? p.enemyHero : p.ownHero;
target2.frozen = true;
}
}
示例11: onCardPlay
// Hero Power: Take control of a random enemy minion until end of turn.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
List<Minion> temp = (ownplay) ? p.enemyMinions : p.ownMinions;
if (temp.Count <= 0) return;
Minion m = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
if (m != null)
{
m.shadowmadnessed = true;
p.shadowmadnessed++;
p.minionGetControlled(m, ownplay, false);
}
}
示例12: onCardIsGoingToBePlayed
// After you cast a spell, deal 2 damage randomly split among all enemies.
public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool ownplay, Minion m)
{
if (m.own == ownplay && c.type == CardDB.cardtype.SPELL)
{
Minion target = (ownplay) ? p.enemyHero : p.ownHero;
p.minionGetDamageOrHeal(target, 1);
List<Minion> temp = (ownplay) ? p.enemyMinions : p.ownMinions;
if (temp.Count > 0) target = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
if (target == null) target = (ownplay) ? p.enemyHero : p.ownHero;
p.minionGetDamageOrHeal(target, 1);
}
}
示例13: onDeathrattle
// Deathrattle: Deal 1-4 damage to a random enemy.
public override void onDeathrattle(Playfield p, Minion m)
{
List<Minion> temp = (m.own) ? p.enemyMinions : p.ownMinions;
if (temp.Count >= 1 && temp.Count >=1 )
{
p.minionGetDamageOrHeal(p.searchRandomMinion(temp, Playfield.searchmode.searchHighestHP), 2);
}
else
{
p.minionGetDamageOrHeal(((m.own)?p.enemyHero : p.ownHero), 2);
}
}
示例14: onCardPlay
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
p.equipWeapon(w, ownplay);
List<Minion> temp = (ownplay) ? p.ownMinions : p.enemyMinions;
if (temp.Count <= 0) return;
// Drew: Null check for searchRandomMinion.
var found = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestAttack);
if (found != null)
{
p.minionGetBuffed(found, 1, 0);
}
}
示例15: onCardPlay
// Give your weapon +3 Attack. Combo: Give a random friendly minion +3 Attack.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
if (ownplay)
{
if (p.ownWeaponDurability >= 1)
{
p.ownWeaponAttack += 3;
p.minionGetBuffed(p.ownHero, 3, 0);
}
if (p.cardsPlayedThisTurn >= 1 && p.ownMinions.Count >= 1)
{
// Drew: Null check for searchRandomMinion.
var found = p.searchRandomMinion(p.ownMinions, Playfield.searchmode.searchLowestAttack);
if (found != null)
{
p.minionGetBuffed(found, 3, 0);
}
}
}
else
{
if (p.enemyWeaponDurability >= 1)
{
p.enemyWeaponAttack += 3;
p.minionGetBuffed(p.enemyHero, 3, 0);
}
if (p.cardsPlayedThisTurn >= 1 && p.enemyMinions.Count >= 1)
{
// Drew: Null check for searchRandomMinion.
var found = p.searchRandomMinion(p.enemyMinions, Playfield.searchmode.searchLowestAttack);
if (found != null)
{
p.minionGetBuffed(found, 3, 0);
}
}
}
}