本文整理汇总了C#中HREngine.Bots.Playfield.getRandomCharExcept_SERVER方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.getRandomCharExcept_SERVER方法的具体用法?C# Playfield.getRandomCharExcept_SERVER怎么用?C# Playfield.getRandomCharExcept_SERVER使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HREngine.Bots.Playfield
的用法示例。
在下文中一共展示了Playfield.getRandomCharExcept_SERVER方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onTurnStartTrigger
// verwandelt zu beginn eures zuges einen zufälligen diener in ein huhn (1/1).
public override void onTurnStartTrigger(Playfield p, Minion triggerEffectMinion, bool turnStartOfOwner)
{
if (triggerEffectMinion.own == turnStartOfOwner)
{
if (p.isServer)
{
Minion choosen = p.getRandomCharExcept_SERVER(null, false);
if (choosen != null) p.minionTransform(choosen, c);
return;
}
Minion tm = null;
int ges = 1000;
foreach (Minion m in p.ownMinions)
{
if (m.Angr + m.Hp < ges)
{
tm = m;
ges = m.Angr + m.Hp;
}
}
foreach (Minion m in p.enemyMinions)
{
if (m.Angr + m.Hp < ges)
{
tm = m;
ges = m.Angr + m.Hp;
}
}
if (ges <= 999)
{
p.minionTransform(tm, c);
}
}
}
示例2: onCardPlay
// Deal $1 damage to a random minion. Repeat until a minion dies.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
int dmg = (ownplay) ? p.getSpellDamageDamage(1) : p.getEnemySpellDamageDamage(1);
if (p.isServer)
{
bool dodmg = true;
while(dodmg)
{
Minion poortarget = p.getRandomCharExcept_SERVER(null, false);
if (poortarget != null)
{
int hp = poortarget.Hp;
p.minionGetDamageOrHeal(poortarget, dmg);
int hp2 = poortarget.Hp;
if (hp2 <= 0 && hp >= 1)
{
dodmg = false;
}
}
else
{
dodmg = false;
}
}
return;
}
int minHp = 100000;
foreach (Minion m in p.ownMinions)
{
int div = 0;
if (m.divineshild) div = 1;
if (m.Hp + div < minHp) minHp = m.Hp;
}
foreach (Minion m in p.enemyMinions)
{
int div = 0;
if (m.divineshild) div = 1;
if (m.Hp + div < minHp) minHp = m.Hp;
}
int dmgdone = (int)Math.Ceiling((double)minHp / (double)dmg) * dmg;
for (int i = 0; i < dmgdone; i++)
{
p.allMinionsGetDamage(1);
}
}
示例3: getBattlecryEffect
CardDB.Card card2 = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.EX1_tk28); // squirrel
//todo better
// kampfschrei:/ verwandelt einen anderen zufälligen diener in einen teufelssaurier (5/5) oder ein eichhörnchen (1/1).
public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
{
if (p.isServer)
{
Minion choosen = p.getRandomCharExcept_SERVER(null, false);
if (choosen != null)
{
int rand = p.getRandomNumber_SERVER(0, 1);
if (rand == 0) p.minionTransform(choosen, card1);
if (rand == 1) p.minionTransform(choosen, card2);
}
return;
}
int oc = p.ownMinions.Count;
int ec = p.enemyMinions.Count;
if (oc == 0 && ec == 0) return;
if (oc > ec)
{
List<Minion> temp = new List<Minion>(p.ownMinions);
temp.AddRange(p.enemyMinions);
temp.Sort((a, b) => a.Hp.CompareTo(b.Hp));//transform the weakest
foreach (Minion m in temp)
{
p.minionTransform(m, card1);
break;
}
}
else
{
List<Minion> temp = new List<Minion>(p.ownMinions);
temp.AddRange(p.enemyMinions);
temp.Sort((a, b) => -a.Hp.CompareTo(b.Hp));//transform the strongest
foreach (Minion m in temp)
{
p.minionTransform(m, card2);
break;
}
}
}
示例4: onCardPlay
// vernichtet alle diener bis auf einen. (zufällige auswahl)
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
if (p.isServer)
{
Minion choosen = p.getRandomCharExcept_SERVER(null, false);
foreach (Minion m in p.ownMinions)
{
if (m == choosen) continue;
p.minionGetDestroyed(m);
}
foreach (Minion m in p.enemyMinions)
{
if (m == choosen) continue;
p.minionGetDestroyed(m);
}
}
p.allMinionsGetDestroyed();
}
示例5: getBattlecryEffect
//todo make it better
// kampfschrei:/ verursacht 3 schaden, der zufällig auf alle anderen charaktere aufgeteilt wird.
public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
{
if (p.isServer)
{
int timesS = 3;
for (int iS = 0; iS < timesS; iS++)
{
Minion poortarget = p.getRandomCharExcept_SERVER(own, true);
if (poortarget != null) p.minionGetDamageOrHeal(poortarget, 1);
}
return;
}
int anz = 3;
for (int i = 0; i < anz; i++)
{
if (p.ownHero.Hp <= anz)
{
p.minionGetDamageOrHeal(p.ownHero, 1);
continue;
}
List<Minion> temp = new List<Minion>(p.enemyMinions);
if (temp.Count == 0)
{
temp.AddRange(p.ownMinions);
}
temp.Sort((a, b) => a.Hp.CompareTo(b.Hp));//destroys the weakest
foreach (Minion m in temp)
{
p.minionGetDamageOrHeal(m, 1);
break;
}
p.minionGetDamageOrHeal(p.enemyHero, 1);
}
}