本文整理汇总了C#中HRSim.Playfield.searchRandomMinion方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.searchRandomMinion方法的具体用法?C# Playfield.searchRandomMinion怎么用?C# Playfield.searchRandomMinion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HRSim.Playfield
的用法示例。
在下文中一共展示了Playfield.searchRandomMinion方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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.playerFirst.doublepriest >= 1) dmg *= (2 * p.playerFirst.doublepriest);
if (p.playerSecond.ownMinions.Count > 0)
{
target = p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
}
else
{
target = p.playerSecond.ownHero;
}
}
else
{
if (p.playerSecond.doublepriest >= 1) dmg *= (2 * p.playerSecond.doublepriest);
if (p.playerFirst.ownMinions.Count > 0)
{
target = p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
}
else
{
target = p.playerFirst.ownHero;
}
}
p.minionGetDamageOrHeal(target, dmg);
}
示例2: 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.playerSecond.ownMinions : p.playerFirst.ownMinions;
Minion m = p.searchRandomMinion(temp, Playfield.searchmode.searchHighestHP);
if (m != null)
{
p.minionGetDamageOrHeal(m, 2, true);
}
}
}
示例3: onCardPlay
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
p.equipWeapon(w, ownplay);
List<Minion> temp = (ownplay) ? p.playerFirst.ownMinions : p.playerSecond.ownMinions;
if (temp.Count <= 0) return;
Minion m = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
if (m != null)
{
m.divineshild = true;
m.taunt = true;
}
}
示例4: 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.playerSecond.ownHero : p.playerFirst.ownHero;
p.minionGetDamageOrHeal(target, 1);
List<Minion> temp = (ownplay) ? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
if (temp.Count > 0) target = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
if (target == null) target = (ownplay) ? p.playerSecond.ownHero : p.playerFirst.ownHero;
p.minionGetDamageOrHeal(target, 1);
}
}
示例5: 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.playerSecond.ownMinions.Count > 0)
{
target = p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
if (target == null) {
target = p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchLowestHP); //damage the lowest (pessimistic variant)
}
}
else
{
target = p.playerSecond.ownHero;
}
}
else
{
if (p.playerFirst.ownMinions.Count > 0)
{
target = p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
if (target == null) {
target = p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchHighestAttack); //damage the Highest (pessimistic variant)
}
}
else
{
target = p.playerFirst.ownHero;
}
}
p.minionGetDamageOrHeal(target, 8);
triggerEffectMinion.stealth = false;
//Implementation is this right?
//p.doDmgTriggers();
}
}
示例6: 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.playerSecond.ownMinions : p.playerFirst.ownMinions;
if (temp.Count >= 1)
{
// Drew: Null check for searchRandomMinion.
var found = p.searchRandomMinion(temp, Playfield.searchmode.searchLowestHP);
if (found != null)
{
p.minionGetDestroyed(found);
}
}
if (p.playerFirst.cardsPlayedThisTurn >= 1) p.lowerWeaponDurability(1000, !ownplay);
}
示例7: 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.playerFirst.ownWeaponDurability >= 1)
{
p.playerFirst.ownWeaponAttack += 3;
p.minionGetBuffed(p.playerFirst.ownHero, 3, 0);
}
if (p.playerFirst.cardsPlayedThisTurn >= 1 && p.playerFirst.ownMinions.Count >= 1)
{
// Drew: Null check for searchRandomMinion.
var found = p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchLowestAttack);
if (found != null)
{
p.minionGetBuffed(found, 3, 0);
}
}
}
else
{
if (p.playerSecond.ownWeaponDurability >= 1)
{
p.playerSecond.ownWeaponAttack += 3;
p.minionGetBuffed(p.playerSecond.ownHero, 3, 0);
}
if (p.playerFirst.cardsPlayedThisTurn >= 1 && p.playerSecond.ownMinions.Count >= 1)
{
// Drew: Null check for searchRandomMinion.
var found = p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchLowestAttack);
if (found != null)
{
p.minionGetBuffed(found, 3, 0);
}
}
}
}
示例8: onCardPlay
// Hero Power (Heroic): Fire a missile for each card in your opponent's hand.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
int dmg = 1;
int cardCount = 0;
if (ownplay)
{
cardCount = p.playerFirst.owncards.Count;
if (p.playerFirst.doublepriest >= 1) dmg *= (2 * p.playerFirst.doublepriest);
}
else
{
cardCount = p.playerSecond.owncards.Count;
if (p.playerSecond.doublepriest >= 1) dmg *= (2 * p.playerSecond.doublepriest);
}
for (int i = 0; i < cardCount; i++)
{
var found = (ownplay)? p.searchRandomMinion(p.playerFirst.ownMinions, Playfield.searchmode.searchHighAttackLowHP) : p.searchRandomMinion(p.playerSecond.ownMinions, Playfield.searchmode.searchHighAttackLowHP);
if (found != null)
{
p.minionGetDamageOrHeal(found, dmg);
}
}
}
示例9: 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.playerFirst.ownMinions : p.playerSecond.ownMinions;
if (temp.Count >= 1)
{
// Drew: Null check for searchRandomMinion.
var found = p.searchRandomMinion(temp, Playfield.searchmode.searchHighestAttack);
if (found != null)
{
p.minionGetBuffed(found, 2, 2);
}
}
}
}
示例10: onDeathrattle
// Deathrattle: Deal 1-4 damage to a random enemy.
public override void onDeathrattle(Playfield p, Minion m)
{
List<Minion> temp = (m.own) ? p.playerSecond.ownMinions : p.playerFirst.ownMinions;
if (temp.Count >= 1 && temp.Count >=1 )
{
var found = p.searchRandomMinion(temp, Playfield.searchmode.searchHighestHP);
if (found != null)
{
p.minionGetDamageOrHeal(found, 2);
}
}
else
{
p.minionGetDamageOrHeal(((m.own)?p.playerSecond.ownHero : p.playerFirst.ownHero), 2);
}
}