本文整理汇总了C#中DamageSchool类的典型用法代码示例。如果您正苦于以下问题:C# DamageSchool类的具体用法?C# DamageSchool怎么用?C# DamageSchool使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DamageSchool类属于命名空间,在下文中一共展示了DamageSchool类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ModDamageDoneFactorSilently
protected internal override void ModDamageDoneFactorSilently(DamageSchool school, float delta)
{
if (m_damageDoneFactors == null)
{
m_damageDoneFactors = new float[(int)DamageSchool.Count];
}
m_damageDoneFactors[(int)school] += delta;
}
示例2: GetDamageDoneFactor
public override float GetDamageDoneFactor(DamageSchool school)
{
if (m_damageDoneFactors == null)
{
return 1;
}
return 1 + m_damageDoneFactors[(int)school];
}
示例3: RemoveDamageDoneModSilently
/// <summary>
/// Modifies the damage for the given school by the given delta.
/// Requires a call to <see cref="WCell.RealmServer.Modifiers.UnitUpdates.UpdateAllDamages"/> afterwards.
/// </summary>
/// <param name="school"></param>
/// <param name="delta"></param>
protected internal override void RemoveDamageDoneModSilently(DamageSchool school, int delta)
{
if (m_damageDoneMods == null)
{
return;
}
m_damageDoneMods[(int)school] -= delta;
}
示例4: AddDamageDoneModSilently
/// <summary>
/// Modifies the damage for the given school by the given delta.
/// Requires a call to <see cref="WCell.RealmServer.Modifiers.UnitUpdates.UpdateAllDamages"/> afterwards.
/// </summary>
/// <param name="school"></param>
/// <param name="delta"></param>
protected internal override void AddDamageDoneModSilently(DamageSchool school, int delta)
{
if (m_damageDoneMods == null)
{
m_damageDoneMods = new int[(int)DamageSchool.Count];
}
m_damageDoneMods[(int)school] += delta;
}
示例5: GetDamageDoneMod
public override int GetDamageDoneMod(DamageSchool school)
{
var amount = 0;
if (IsHunterPet && m_master != null)
{
if (school != DamageSchool.Physical)
{
// "0.13% spell damage (0.18 spell damage with 2/2 Wild Hunt)"
var bonus = m_master.GetDamageDoneMod(school);
amount += (bonus * PetMgr.PetSpellDamageOfOwnerPercent + 50) / 100; // rounding
}
}
if (m_damageDoneMods != null)
{
amount += m_damageDoneMods[(int)school];
}
return amount;
}
示例6: GetCritChance
public override float GetCritChance(DamageSchool school)
{
var value = m_entry.Rank > CreatureRank.Normal ? BossSpellCritChance : 0;
if (m_CritMods != null)
{
value += m_CritMods[(int)school];
}
return value;
}
示例7: CalcPowerCost
public int CalcPowerCost(Unit caster, DamageSchool school)
{
return caster.GetPowerCost(school, this, CalcBasePowerCost(caster));
}
示例8: SetResistance
public void SetResistance(DamageSchool school, int value)
{
Resistances[(uint)school] = value;
}
示例9: GetResistance
public int GetResistance(DamageSchool school)
{
if (Resistances == null)
{
return 0;
}
return Resistances.Get((uint)school);
}
示例10: ConsumePower
/// <summary>
/// Tries to consume the given amount of Power, also considers modifiers to Power-cost.
/// </summary>
public bool ConsumePower(DamageSchool type, Spell spell, int neededPower)
{
neededPower = GetPowerCost(type, spell, neededPower);
if (Power >= neededPower)
{
Power -= neededPower;
return true;
}
return false;
}
示例11: ModDamageTakenPctMod
public void ModDamageTakenPctMod(DamageSchool[] schools, int delta)
{
if (m_damageTakenPctMods == null)
{
m_damageTakenPctMods = CreateDamageSchoolArr();
}
foreach (var school in schools)
{
m_damageTakenPctMods[(int)school] += delta;
}
}
示例12: GetGeneratedThreat
/// <summary>
/// Threat mod in percent
/// </summary>
public virtual int GetGeneratedThreat(int dmg, DamageSchool school, SpellEffect effect)
{
if (m_threatMods == null)
{
return dmg;
}
return dmg + ((dmg * m_threatMods[(int)school]) / 100);
}
示例13: GetPowerCost
/// <summary>
/// Returns the modified power-cost needed to cast a Spell of the given DamageSchool
/// and the given base amount of power required
/// </summary>
public virtual int GetPowerCost(DamageSchool school, Spell spell, int cost)
{
int modifier = PowerCostModifier;
if (m_schoolPowerCostMods != null)
{
modifier += m_schoolPowerCostMods[(int)school];
}
cost += modifier;
cost = (int)(Math.Round(PowerCostMultiplier) * cost);
return cost;
}
示例14: GetTargetResistanceMod
//public void ModDebuffResistance(DamageTypeMask schools, float delta)
//{
// foreach (var school in UnitMechanics.DamageTypeMasks) {
// if ((schools & school) != 0) {
// ModDebuffResistance(UnitMechanics.DamageTypeLookup[school], delta);
// }
// }
//}
#endregion
#region Target Resistances
public int GetTargetResistanceMod(DamageSchool school)
{
if (m_TargetResMods == null)
{
return 0;
}
return m_TargetResMods[(int)school];
}
示例15: IsImmune
/// <summary>
/// Indicates whether the owner is immune against the given DamageSchool
/// </summary>
public bool IsImmune(DamageSchool school)
{
return m_dmgImmunities != null && m_dmgImmunities[(int)school] > 0;
}