本文整理汇总了C#中GameLiving.GetResist方法的典型用法代码示例。如果您正苦于以下问题:C# GameLiving.GetResist方法的具体用法?C# GameLiving.GetResist怎么用?C# GameLiving.GetResist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameLiving
的用法示例。
在下文中一共展示了GameLiving.GetResist方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateEffectDuration
/// <summary>
/// Calculates the effect duration in milliseconds
/// </summary>
/// <param name="target">The effect target</param>
/// <param name="effectiveness">The effect effectiveness</param>
/// <returns>The effect duration in milliseconds</returns>
protected override int CalculateEffectDuration(GameLiving target, double effectiveness)
{
double duration = base.CalculateEffectDuration(target, effectiveness);
duration -= duration * target.GetResist(Spell.DamageType) * 0.01;
if (duration < 1)
duration = 1;
else if (duration > (Spell.Duration * 4))
duration = (Spell.Duration * 4);
return (int)duration;
}
示例2: DamageTarget
private void DamageTarget(GameLiving target, GameLiving caster)
{
double modifier = 0.5 + (caster.GetModifiedSpecLevel("Soulrending") * 0.01);
int basedamage = (int)(250 * modifier);
int resist = basedamage * target.GetResist(eDamageType.Spirit) / -100;
int damage = basedamage + resist;
int heal = (int)(damage * 0.75);
int modheal = caster.MaxHealth - caster.Health;
if (modheal > heal)
modheal = heal;
caster.Health += modheal;
GamePlayer player = caster as GamePlayer;
if (player != null)
player.Out.SendMessage("You hit " + target.Name + " for " + damage + "(" + resist + ") points of damage!", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
if (caster is GamePlayer && modheal > 0)
((GamePlayer)caster).Out.SendMessage("Your Soul Quench returns " + modheal + " lifepoints to you", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
GamePlayer targetPlayer = target as GamePlayer;
if (targetPlayer != null)
{
if (targetPlayer.IsStealthed)
targetPlayer.Stealth(false);
}
foreach (GamePlayer p in target.GetPlayersInRadius(false, WorldMgr.VISIBILITY_DISTANCE))
{
p.Out.SendSpellEffectAnimation(caster, target, 1145, 0, false, 1);
p.Out.SendCombatAnimation(caster, target, 0, 0, 0, 0, 0x14, target.HealthPercent);
}
//target.TakeDamage(caster, eDamageType.Spirit, damage, 0);
AttackData ad = new AttackData();
ad.AttackResult = GameLiving.eAttackResult.HitUnstyled;
ad.Attacker = caster;
ad.Target = target;
ad.DamageType = eDamageType.Spirit;
ad.Damage = damage;
target.OnAttackedByEnemy(ad);
caster.DealDamage(ad);
}
示例3: DamageTarget
private void DamageTarget(GameLiving target, GameLiving caster)
{
int resist = 251 * target.GetResist(eDamageType.Crush) / -100;
int damage = 251 + resist;
GamePlayer player = caster as GamePlayer;
if (player != null)
player.Out.SendMessage("You hit " + target.Name + " for " + damage + "(" + resist + ") points of damage!", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
GamePlayer targetPlayer = target as GamePlayer;
if (targetPlayer != null)
{
if (targetPlayer.IsStealthed)
targetPlayer.Stealth(false);
}
foreach (GamePlayer p in target.GetPlayersInRadius(false, WorldMgr.VISIBILITY_DISTANCE))
{
p.Out.SendSpellEffectAnimation(caster, target, 7043, 0, false, 1);
p.Out.SendCombatAnimation(caster, target, 0, 0, 0, 0, 0x14, target.HealthPercent);
}
//target.TakeDamage(caster, eDamageType.Spirit, damage, 0);
AttackData ad = new AttackData();
ad.AttackResult = GameLiving.eAttackResult.HitUnstyled;
ad.Attacker = caster;
ad.Target = target;
ad.DamageType = eDamageType.Crush;
ad.Damage = damage;
target.OnAttackedByEnemy(ad);
caster.DealDamage(ad);
if (target.EffectList.GetOfType<WhirlingStaffEffect>() == null)
{
WhirlingStaffEffect effect = new WhirlingStaffEffect();
effect.Start(target);
}
}
示例4: CalculateEffectDuration
/// <summary>
/// Calculates the effect duration in milliseconds
/// </summary>
/// <param name="target">The effect target</param>
/// <param name="effectiveness">The effect effectiveness</param>
/// <returns>The effect duration in milliseconds</returns>
protected override int CalculateEffectDuration(GameLiving target, double effectiveness)
{
//TODO: duration depends on target resists (maybe body resist for all)
// int resist = target.GetResist(m_spell.DamageType);
double duration = base.CalculateEffectDuration(target, effectiveness);
duration -= duration * target.GetResist(eDamageType.Body) * 0.01;
if (duration < 1)
duration = 1;
else if (duration > (Spell.Duration * 4))
duration = (Spell.Duration * 4);
return (int)duration;
}
示例5: DamageTarget
private void DamageTarget(GameLiving target, GameLiving caster, double counter)
{
int level = caster.GetModifiedSpecLevel("Stormcalling");
if (level > 50)
level = 50;
modifier = 0.5 + (level * 0.01) * Math.Pow(0.75, counter);
basedamage = (int)(450 * modifier);
resist = basedamage * target.GetResist(eDamageType.Energy) / -100;
damage = basedamage + resist;
GamePlayer player = caster as GamePlayer;
if (player != null)
player.Out.SendMessage("You hit " + target.Name + " for " + damage + "(" + resist + ") points of damage!", eChatType.CT_YouHit, eChatLoc.CL_SystemWindow);
GamePlayer targetPlayer = target as GamePlayer;
if (targetPlayer != null)
{
if (targetPlayer.IsStealthed)
targetPlayer.Stealth(false);
}
foreach (GamePlayer p in target.GetPlayersInRadius(false, WorldMgr.VISIBILITY_DISTANCE))
{
p.Out.SendSpellEffectAnimation(caster, target, 3505, 0, false, 1);
p.Out.SendCombatAnimation(caster, target, 0, 0, 0, 0, 0x14, target.HealthPercent);
}
//target.TakeDamage(caster, eDamageType.Spirit, damage, 0);
AttackData ad = new AttackData();
ad.AttackResult = GameLiving.eAttackResult.HitUnstyled;
ad.Attacker = caster;
ad.Target = target;
ad.DamageType = eDamageType.Energy;
ad.Damage = damage;
target.OnAttackedByEnemy(ad);
caster.DealDamage(ad);
}