本文整理汇总了C#中HREngine.Bots.Playfield类的典型用法代码示例。如果您正苦于以下问题:C# Playfield类的具体用法?C# Playfield怎么用?C# Playfield使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Playfield类属于HREngine.Bots命名空间,在下文中一共展示了Playfield类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: onCardIsGoingToBePlayed
// erhaltet jedes mal einen „feuerball“-zauber auf eure hand, wenn ihr einen zauber wirkt.
public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion, Minion target, int choice)
{
if (wasOwnCard == triggerEffectMinion.own && c.type == CardDB.cardtype.SPELL)
{
p.drawACard(CardDB.cardIDEnum.CS2_029, wasOwnCard, true);
}
}
示例2: onCardIsGoingToBePlayed
// wenn ein spieler einen zauber wirkt, erhält der andere spieler eine kopie desselben auf seine hand.
public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion)
{
if (c.type == CardDB.cardtype.SPELL)
{
p.drawACard(c.cardIDenum, !wasOwnCard, true);
}
}
示例3: onCardPlay
// verleiht euren dienern bis zu eurem nächsten zug verstohlenheit/.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
if (ownplay)
{
foreach (Minion m in p.ownMinions)
{
if (!m.stealth)
{
m.stealth = true;
m.concedal = true;
}
}
}
else
{
foreach (Minion m in p.enemyMinions)
{
if (!m.stealth)
{
m.stealth = true;
m.concedal = true;
}
}
}
}
示例4: onAuraEnds
public override void onAuraEnds(Playfield p, Minion own)
{
if (own.own)
{
p.anzOwnHorsemen--;
if (p.anzOwnHorsemen < 1)
{
p.ownHero.immune = false;
if (p.ownWeaponCard.name == CardDB.cardName.runeblade)
{
int bonus = (p.ownWeaponCard.cardIDenum == CardDB.cardIDEnum.NAX9_05H) ? 6 : 3;
p.minionGetBuffed(p.ownHero, bonus, 0);
p.ownWeaponAttack += bonus;
}
}
}
else
{
p.anzEnemyHorsemen--;
if (p.anzEnemyHorsemen < 1)
{
p.enemyHero.immune = false;
if (p.enemyWeaponCard.name == CardDB.cardName.runeblade)
{
int bonus = (p.enemyWeaponCard.cardIDenum == CardDB.cardIDEnum.NAX9_05H) ? 6 : 3;
p.minionGetBuffed(p.enemyHero, bonus, 0);
p.enemyWeaponAttack += bonus;
}
}
}
}
示例5: getBattlecryEffect
//Battlecry: Give all minions in your hand and deck +1/+1.
public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
{
if (p.isServer)
{
if (own.own)
{
foreach (Handmanager.Handcard hc in p.owncards)
{
if (hc.card.type == CardDB.cardtype.MOB)
{
hc.addattack++;
hc.addHp++;
}
}
foreach (Handmanager.Handcard hc in p.myDeck)
{
if (hc.card.type == CardDB.cardtype.MOB)
{
hc.addattack++;
hc.addHp++;
}
}
}
else
{
foreach (Handmanager.Handcard hc in p.EnemyCards)
{
if (hc.card.type == CardDB.cardtype.MOB)
{
hc.addattack++;
hc.addHp++;
}
}
foreach (Handmanager.Handcard hc in p.enemyDeck)
{
if (hc.card.type == CardDB.cardtype.MOB)
{
hc.addattack++;
hc.addHp++;
}
}
}
return;
}
if (own.own)
{
foreach (Handmanager.Handcard hc in p.owncards)
{
if (hc.card.type == CardDB.cardtype.MOB)
{
hc.addattack++;
hc.addHp++;
}
}
}
}
示例6: onSecretPlay
public override void onSecretPlay(Playfield p, bool ownplay, Minion attacker, Minion target, out int number)
{
number = 0;
if (ownplay)
{
int posi = p.ownMinions.Count;
p.callKid(kid, posi, true);
if (p.ownMinions.Count >= 1)
{
if (p.ownMinions[p.ownMinions.Count - 1].name == CardDB.cardName.spellbender)
{
number = p.ownMinions[p.ownMinions.Count - 1].entityID;
}
}
}
else
{
int posi = p.enemyMinions.Count;
p.callKid(kid, posi, false);
if (p.enemyMinions.Count >= 1)
{
if (p.enemyMinions[p.enemyMinions.Count - 1].name == CardDB.cardName.spellbender)
{
number = p.enemyMinions[p.enemyMinions.Count - 1].entityID;
}
}
}
}
示例7: getBattlecryEffect
//todo: what happens if the target is damaged?
//Battlecry: Swap Health with another minion.
public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
{
if (target == null) return;
int volMHp = own.maxHp;
int tarMHp = target.maxHp;
target.maxHp = volMHp;
if (tarMHp < volMHp)//minion has lower maxHp as his card -> heal his hp
{
target.Hp += volMHp - tarMHp; //heal minion
}
if (target.Hp > target.maxHp)
{
target.Hp = target.maxHp;
}
own.maxHp = tarMHp;
if (volMHp < tarMHp)//minion has lower maxHp as his card -> heal his hp
{
own.Hp += tarMHp - volMHp; //heal minion
}
if (own.Hp > own.maxHp)
{
own.Hp = own.maxHp;
}
}
示例8: 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;
bool hasmech = false;
foreach (Minion m in temp)
{
//if we have allready a mechanical, we are buffed
if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL) hasmech=true;
}
if (hasmech)
{
if (ownplay)
{
p.ownWeaponAttack += 2;
p.minionGetBuffed(p.ownHero, 2, 0);
}
else
{
p.enemyWeaponAttack += 2;
p.minionGetBuffed(p.enemyHero, 2, 0);
}
}
}
示例9: onMinionIsSummoned
public override void onMinionIsSummoned(Playfield p, Minion triggerEffectMinion, Minion summonedMinion)
{
if ((TAG_RACE)summonedMinion.handcard.card.race == TAG_RACE.MECHANICAL)
{
List<Minion> temp = (triggerEffectMinion.own) ? p.ownMinions : p.enemyMinions;
foreach (Minion m in temp)
{
//if we have allready a mechanical, we are buffed
if ((TAG_RACE)m.handcard.card.race == TAG_RACE.MECHANICAL) return;
}
//we had no mechanical, but now!
if (triggerEffectMinion.own)
{
p.ownWeaponAttack += 2;
p.minionGetBuffed(p.ownHero, 2, 0);
}
else
{
p.enemyWeaponAttack += 2;
p.minionGetBuffed(p.enemyHero, 2, 0);
}
}
}
示例10: onCardPlay
CardDB.Card kid = CardDB.Instance.getCardDataFromID(CardDB.cardIDEnum.CS2_101t);//silverhandrecruit
// Summon two 1/1 Recruits.
public override void onCardPlay(Playfield p, bool ownplay, Minion target, int choice)
{
int posi = (ownplay) ? p.ownMinions.Count : p.enemyMinions.Count;
p.callKid(kid, posi, ownplay);
p.callKid(kid, posi, ownplay);
}
示例11: getPlayPenalty
// kampfschrei:/ fügt einem diener 1 schaden zu und verleiht ihm +2 angriff.
public override int getPlayPenalty(Playfield p, Minion m, Minion target, int choice, bool isLethal)
{
if (target.own)
{
if (m.Hp == 1) return 50;
if (!m.Ready)
{
return 50;
}
}
else
{
if (m.handcard.card.type == CardDB.cardtype.MOB && p.ownMinions.Count == 0) return 0;
//allow it if you have biggamehunter
foreach (Handmanager.Handcard hc in p.owncards)
{
if (hc.card.name == CardDB.cardName.biggamehunter || hc.card.name == CardDB.cardName.shadowworddeath) return 0;
}
if (m.Hp == 1)
{
return 0;
}
if (!m.wounded && (m.Angr >= 4 || m.Hp >= 5))
{
foreach (Handmanager.Handcard hc in p.owncards)
{
if (hc.card.name == CardDB.cardName.execute) return 0;
}
}
return base.getValueOfMinion(4,5);
}
return 0;
}
示例12: 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);
}
示例13: onCardIsGoingToBePlayed
// erhält jedes Mal +1/+1, wenn Ihr eine Karte mit uberladung< ausspielt.
public override void onCardIsGoingToBePlayed(Playfield p, CardDB.Card c, bool wasOwnCard, Minion triggerEffectMinion, Minion target, int choice)
{
if (wasOwnCard == triggerEffectMinion.own && c.Recall)
{
p.minionGetBuffed(triggerEffectMinion, 1, 1);
}
}
示例14: getBattlecryEffect
// Battlecry: Deal 4 damage to a random enemy minion.
public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
{
if (p.isServer)
{
Minion choosen = p.getRandomMinionFromSide_SERVER(!own.own, false);
if (choosen != null) p.minionGetDamageOrHeal(choosen, 4);
return;
}
List<Minion> temp = (own.own) ? p.enemyMinions : p.ownMinions;
int times = 4;
if (temp.Count >= 1)
{
//search Minion with lowest hp
Minion enemy = temp[0];
int minhp = 10000;
foreach (Minion m in temp)
{
if (m.Hp >= times + 1 && minhp > m.Hp)
{
enemy = m;
minhp = m.Hp;
}
}
p.minionGetDamageOrHeal(enemy, times);
}
}
示例15: getBattlecryEffect
//Battlecry: Give a friendly Beast Immune this turn.
public override void getBattlecryEffect(Playfield p, Minion own, Minion target, int choice)
{
if (target != null && target.handcard.card.race == TAG_RACE.PET)
{
target.immune = true;
}
}