本文整理汇总了C#中HREngine.Bots.Playfield.secretTrigger_HeroGotDmg方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.secretTrigger_HeroGotDmg方法的具体用法?C# Playfield.secretTrigger_HeroGotDmg怎么用?C# Playfield.secretTrigger_HeroGotDmg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HREngine.Bots.Playfield
的用法示例。
在下文中一共展示了Playfield.secretTrigger_HeroGotDmg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getDamageOrHeal
public void getDamageOrHeal(int dmg, Playfield p, bool isMinionAttack, bool dontCalcLostDmg)
{
if (this.Hp <= 0) return;
if (this.immune && dmg > 0) return;
if (this.isHero)
{
int copy = this.Hp;
if (dmg < 0 || this.armor <= 0)
{
//if (dmg < 0) return;
//heal
bool BolfRamshield = false;
if (dmg > 0)
{
foreach (Minion m in (this.own) ? p.ownMinions : p.enemyMinions)
{
if (m.name == CardDB.cardName.bolframshield)
{
BolfRamshield = true;
m.getDamageOrHeal(dmg, p, isMinionAttack, dontCalcLostDmg);
}
}
}
if (!BolfRamshield)
{
this.Hp = Math.Min(30, this.Hp - dmg);
}
if (copy < this.Hp)
{
p.tempTrigger.charsGotHealed++;
}
if (copy - this.Hp >= 1)
{
p.secretTrigger_HeroGotDmg(this.own, copy - this.Hp);
}
}
else
{
if (this.armor > 0 && dmg > 0)
{
int rest = this.armor - dmg;
if (rest < 0)
{
bool BolfRamshield = false;
foreach (Minion m in (this.own) ? p.ownMinions : p.enemyMinions)
{
if (m.name == CardDB.cardName.bolframshield)
{
BolfRamshield = true;
m.getDamageOrHeal(-rest, p, isMinionAttack, dontCalcLostDmg);
}
}
if (!BolfRamshield)
{
this.Hp += rest;
p.secretTrigger_HeroGotDmg(this.own, rest);
}
}
this.armor = Math.Max(0, this.armor - dmg);
}
}
if (this.cantLowerHPbelowONE && this.Hp <= 0) this.Hp = 1;
if (this.Hp < copy)
{
this.anzGotDmg++;
this.gotDmgRaw += dmg;
}
return;
}
//its a Minion--------------------------------------------------------------
int damage = dmg;
int heal = 0;
if (dmg < 0) heal = -dmg;
bool woundedbefore = this.wounded;
if (heal < 0) // heal was shifted in damage
{
damage = -1 * heal;
heal = 0;
}
if (damage >= 1) this.allreadyAttacked = true;
if (damage >= 1 && this.divineshild)
{
this.divineshild = false;
if (!own && !dontCalcLostDmg && p.turnCounter == 0)
{
//.........这里部分代码省略.........