本文整理汇总了C#中BaseCreature.UseSkill方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.UseSkill方法的具体用法?C# BaseCreature.UseSkill怎么用?C# BaseCreature.UseSkill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.UseSkill方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseProvo
public static void UseProvo(BaseCreature from, bool randomly)
{
if (from.Combatant == null && randomly || !CheckBarding(from))
return;
if (!CanUse(from))
return;
if (!from.UseSkill(SkillName.Provocation))
return;
var targetone = FindRandomTarget(from, randomly);
if (targetone == null)
return;
if (from.Target != null)
from.Target.Invoke(from, targetone);
var targettwo = randomly ? FindRandomTarget(from, randomly) : from.Combatant;
if (targettwo == null)
return;
if (from.Target != null)
from.Target.Invoke(from, targettwo);
}
示例2: UseDiscord
public static void UseDiscord(BaseCreature from)
{
if (from.Combatant == null || !CanUse(from) || !CheckBarding(from))
return;
//int effect = 0.0;
//if ( SkillHandlers.Discordance.GetEffect( from.Combatant, ref effect ) )
//return;
if (!from.UseSkill(SkillName.Discordance))
return;
if (from.Combatant is BaseCreature)
if (from.Target != null)
from.Target.Invoke(from, from.Combatant);
else
{
var effect = -(from.Skills[SkillName.Discordance].Value/5.0);
var duration = TimeSpan.FromSeconds(from.Skills[SkillName.Discordance].Value*2);
ResistanceMod[] mods =
{
new ResistanceMod(ResistanceType.Physical, (int) (effect*0.01)),
new ResistanceMod(ResistanceType.Fire, (int) (effect*0.01)),
new ResistanceMod(ResistanceType.Cold, (int) (effect*0.01)),
new ResistanceMod(ResistanceType.Poison, (int) (effect*0.01)),
new ResistanceMod(ResistanceType.Energy, (int) (effect*0.01))
};
TimedResistanceMod.AddMod(from.Combatant, "Discordance", mods, duration);
from.Combatant.AddStatMod(new StatMod(StatType.Str, "DiscordanceStr",
(int) (from.Combatant.RawStr*effect), duration));
from.Combatant.AddStatMod(new StatMod(StatType.Int, "DiscordanceInt",
(int) (from.Combatant.RawInt*effect), duration));
from.Combatant.AddStatMod(new StatMod(StatType.Dex, "DiscordanceDex",
(int) (from.Combatant.RawDex*effect), duration));
}
}
示例3: UsePeace
public static void UsePeace(BaseCreature from)
{
if (from.Combatant == null || !CanUse(from) || !CheckBarding(from))
return;
if (!from.UseSkill(SkillName.Peacemaking))
return;
if (from.Combatant is PlayerMobile)
{
#if ML
PlayerMobile pm = (PlayerMobile)from.Combatant;
if ( pm.PeacedUntil <= DateTime.UtcNow )
{
pm.PeacedUntil = DateTime.UtcNow + TimeSpan.FromSeconds( (int)(from.Skills[SkillName.Peacemaking].Value / 5) );
pm.SendLocalizedMessage( 500616 ); // You hear lovely music, and forget to continue battling!
}
#endif
}
else if (from.Target != null)
from.Target.Invoke(from, from.Combatant);
}
示例4: UseDiscord
public static bool UseDiscord(BaseCreature from, Mobile target)
{
if (target == null || !target.InLOS(from) || CheckBarding(from) == null)
return false;
if (from.Spell != null)
from.Spell = null;
if (!from.UseSkill(SkillName.Discordance))
return false;
if (from.Target is Discordance.DiscordanceTarget)
{
from.Target.Invoke(from, target);
return true;
}
return false;
}