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


C# Unit.GetLeastResistantSchool方法代码示例

本文整理汇总了C#中WCell.RealmServer.Entities.Unit.GetLeastResistantSchool方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.GetLeastResistantSchool方法的具体用法?C# Unit.GetLeastResistantSchool怎么用?C# Unit.GetLeastResistantSchool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WCell.RealmServer.Entities.Unit的用法示例。


在下文中一共展示了Unit.GetLeastResistantSchool方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckDebuffResist

		/// <summary>
		/// Checks whether the given target resisted the debuff, represented through the given spell
		/// </summary>
		public static CastMissReason CheckDebuffResist(Unit target, Spell spell, int casterLevel, bool hostile)
		{
			var missReason = CastMissReason.None;
			if (hostile && target.CheckDebuffResist(casterLevel, target.GetLeastResistantSchool(spell)))
			{
				missReason = CastMissReason.Resist;
			}
			return missReason;
		}
开发者ID:enjoii,项目名称:WCell,代码行数:12,代码来源:SpellCast.Aura.cs

示例2: GetModifiedDamage

		/// <summary>
		/// Get's Basepoints for a spell after applying DamageMods.
		/// </summary>
		public int GetModifiedDamage(Unit caster)
		{
			if (IsPeriodic)
			{
				return caster.Auras.GetModifiedInt(SpellModifierType.PeriodicEffectValue, this.Spell, CalcEffectValue());
			}
			else
			{
				return caster.GetFinalDamage(caster.GetLeastResistantSchool(this.Spell), CalcEffectValue(), this.Spell);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:14,代码来源:SpellEffect.cs

示例3: CheckCastHit

		/// <summary>
		/// Indicates whether a spell hit a target or not
		/// TODO: Actually check whether a spell 'Misses' (CastMissReason.Miss)
		/// </summary>
		public CastMissReason CheckCastHit(Unit target, Spell spell)
		{
			if (CasterObject != null && CasterObject.MayAttack(target))
			{
				var school = target.GetLeastResistantSchool(spell);
				// evasion
				if (target.IsEvading)
				{
					return CastMissReason.Evade;
				}
				// immune & invul
				if (!spell.Attributes.HasFlag(SpellAttributes.UnaffectedByInvulnerability) ||
					(target is Character && ((Character)target).Role.IsStaff))
				{
					if (target.IsInvulnerable)
					{
						return CastMissReason.Immune_2;
					}

					if (spell.Schools.All(target.IsImmune))
					{
						return CastMissReason.Immune;
					}
				}

				//// avoid/miss
				//var avoidance = target.GetSpellAvoidancePct(school);
				//if (avoidance > 0 && Utility.Random(1, 101) < avoidance)
				//{
				//    return CastMissReason.Miss;
				//}


				// resist
				if (target.CheckResist(CasterUnit, school, spell.Mechanic) && !spell.AttributesExB.HasFlag(SpellAttributesExB.CannotBeResisted))
				{
					return CastMissReason.Resist;
				}
			}

			return CastMissReason.None;
		}
开发者ID:MeaNone,项目名称:WCell,代码行数:46,代码来源:SpellCast.cs


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