当前位置: 首页>>代码示例>>C#>>正文


C# DamageSchool类代码示例

本文整理汇总了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;
		}
开发者ID:remixod,项目名称:netServer,代码行数:8,代码来源:NPC.Mechanics.cs

示例2: GetDamageDoneFactor

		public override float GetDamageDoneFactor(DamageSchool school)
		{
			if (m_damageDoneFactors == null)
			{
				return 1;
			}
			return 1 + m_damageDoneFactors[(int)school];
		}
开发者ID:remixod,项目名称:netServer,代码行数:8,代码来源:NPC.Mechanics.cs

示例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;
		}
开发者ID:remixod,项目名称:netServer,代码行数:14,代码来源:NPC.Mechanics.cs

示例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;
		}
开发者ID:remixod,项目名称:netServer,代码行数:14,代码来源:NPC.Mechanics.cs

示例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;
		}
开发者ID:remixod,项目名称:netServer,代码行数:19,代码来源:NPC.Mechanics.cs

示例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;
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:9,代码来源:NPC.cs

示例7: CalcPowerCost

 public int CalcPowerCost(Unit caster, DamageSchool school)
 {
     return caster.GetPowerCost(school, this, CalcBasePowerCost(caster));
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:4,代码来源:Spell.cs

示例8: SetResistance

		public void SetResistance(DamageSchool school, int value)
		{
			Resistances[(uint)school] = value;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:4,代码来源:NPCEntry.cs

示例9: GetResistance

		public int GetResistance(DamageSchool school)
		{
			if (Resistances == null)
			{
				return 0;
			}
			return Resistances.Get((uint)school);
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:NPCEntry.cs

示例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;
		}
开发者ID:ray2006,项目名称:WCell,代码行数:15,代码来源:Unit.cs

示例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;
			}
		}
开发者ID:enjoii,项目名称:WCell,代码行数:12,代码来源:Unit.Mechanics.cs

示例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);
		}
开发者ID:enjoii,项目名称:WCell,代码行数:11,代码来源:Unit.Mechanics.cs

示例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;
		}
开发者ID:ray2006,项目名称:WCell,代码行数:17,代码来源:Unit.cs

示例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];
		}
开发者ID:enjoii,项目名称:WCell,代码行数:19,代码来源:Unit.Mechanics.cs

示例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;
		}
开发者ID:enjoii,项目名称:WCell,代码行数:7,代码来源:Unit.Mechanics.cs


注:本文中的DamageSchool类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。