本文整理汇总了C#中Server.MirDatabase.UserMagic.GetDelay方法的典型用法代码示例。如果您正苦于以下问题:C# UserMagic.GetDelay方法的具体用法?C# UserMagic.GetDelay怎么用?C# UserMagic.GetDelay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.MirDatabase.UserMagic
的用法示例。
在下文中一共展示了UserMagic.GetDelay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LevelMagic
public void LevelMagic(UserMagic magic)
{
byte exp = (byte)(Envir.Random.Next(3) + 1);
if ((Settings.MentorSkillBoost) && (Info.Mentor != 0) && (Info.isMentor))
{
Buff buff = Buffs.Where(e => e.Type == BuffType.Mentee).FirstOrDefault();
if (buff != null)
{
CharacterInfo Mentor = Envir.GetCharacterInfo(Info.Mentor);
PlayerObject player = Envir.GetPlayer(Mentor.Name);
if (player.CurrentMap == CurrentMap && Functions.InRange(player.CurrentLocation, CurrentLocation, Globals.DataRange) && !player.Dead)
if (SkillNeckBoost == 1) exp *= 2;
}
}
exp *= SkillNeckBoost;
if (Level == 65535) exp = byte.MaxValue;
int oldLevel = magic.Level;
switch (magic.Level)
{
case 0:
if (Level < magic.Info.Level1)
return;
magic.Experience += exp;
if (magic.Experience >= magic.Info.Need1)
{
magic.Level++;
magic.Experience = (ushort)(magic.Experience - magic.Info.Need1);
RefreshStats();
}
break;
case 1:
if (Level < magic.Info.Level2)
return;
magic.Experience += exp;
if (magic.Experience >= magic.Info.Need2)
{
magic.Level++;
magic.Experience = (ushort)(magic.Experience - magic.Info.Need2);
RefreshStats();
}
break;
case 2:
if (Level < magic.Info.Level3)
return;
magic.Experience += exp;
if (magic.Experience >= magic.Info.Need3)
{
magic.Level++;
magic.Experience = 0;
RefreshStats();
}
break;
default:
return;
}
if (oldLevel != magic.Level)
{
long delay = magic.GetDelay();
Enqueue(new S.MagicDelay { Spell = magic.Spell, Delay = delay });
}
Enqueue(new S.MagicLeveled { Spell = magic.Spell, Level = magic.Level, Experience = magic.Experience });
}
示例2: LevelMagic
public void LevelMagic(UserMagic magic)
{
byte exp = (byte)(Envir.Random.Next(3) + 1);
if (HasSkillNecklace) exp *= 3;
if (Level == 255) exp = byte.MaxValue;
int oldLevel = magic.Level;
switch (magic.Level)
{
case 0:
if (Level < magic.Info.Level1)
return;
magic.Experience += exp;
if (magic.Experience >= magic.Info.Need1)
{
magic.Level++;
magic.Experience = (ushort)(magic.Experience - magic.Info.Need1);
RefreshStats();
}
break;
case 1:
if (Level < magic.Info.Level2)
return;
magic.Experience += exp;
if (magic.Experience >= magic.Info.Need2)
{
magic.Level++;
magic.Experience = (ushort)(magic.Experience - magic.Info.Need2);
RefreshStats();
}
break;
case 2:
if (Level < magic.Info.Level3)
return;
magic.Experience += exp;
if (magic.Experience >= magic.Info.Need3)
{
magic.Level++;
magic.Experience = 0;
RefreshStats();
}
break;
default:
return;
}
if (oldLevel != magic.Level)
{
long delay = magic.GetDelay();
Enqueue(new S.MagicDelay { Spell = magic.Spell, Delay = delay });
}
Enqueue(new S.MagicLeveled { Spell = magic.Spell, Level = magic.Level, Experience = magic.Experience });
}