本文整理汇总了C#中HRSim.Playfield.secretTrigger_HeroGotDmg方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.secretTrigger_HeroGotDmg方法的具体用法?C# Playfield.secretTrigger_HeroGotDmg怎么用?C# Playfield.secretTrigger_HeroGotDmg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HRSim.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
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)
{
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++;
}
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)
{
if (isMinionAttack)
{
p.playerFirst.lostDamage += damage - 1;
}
else
{
p.playerFirst.lostDamage += (damage - 1) * (damage - 1);
}
}
return;
}
if (this.cantLowerHPbelowONE && damage >= 1 && damage >= this.Hp) damage = this.Hp - 1;
if (!own && !dontCalcLostDmg && this.Hp < damage && p.turnCounter == 0)
{
if (isMinionAttack)
{
p.playerFirst.lostDamage += (damage - this.Hp);
}
else
{
p.playerFirst.lostDamage += (damage - this.Hp) * (damage - this.Hp);
}
}
int hpcopy = this.Hp;
if (damage >= 1)
//.........这里部分代码省略.........