本文整理汇总了C#中Server.MirObjects.PlayerObject.ChangeMP方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerObject.ChangeMP方法的具体用法?C# PlayerObject.ChangeMP怎么用?C# PlayerObject.ChangeMP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.MirObjects.PlayerObject
的用法示例。
在下文中一共展示了PlayerObject.ChangeMP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Act
//.........这里部分代码省略.........
monster.Master = player;
monster.MaxPetLevel = 7;
monster.Direction = player.Direction;
monster.ActionTime = SMain.Envir.Time + 1000;
monster.Spawn(player.CurrentMap, player.CurrentLocation);
player.Pets.Add(monster);
}
break;
case ActionType.AddNameList:
path = (string)act.Params[0];
if (File.ReadAllLines(path).All(t => player.Name != t))
{
using (var line = File.AppendText(path))
{
line.WriteLine(player.Name);
}
}
break;
case ActionType.DelNameList:
path = (string)act.Params[0];
File.WriteAllLines(path, File.ReadLines(path).Where(l => l != player.Name).ToList());
break;
case ActionType.ClearNameList:
path = (string)act.Params[0];
File.WriteAllLines(path, new string[] { });
break;
case ActionType.GiveHP:
player.ChangeHP((int)act.Params[0]);
break;
case ActionType.GiveMP:
player.ChangeMP((int)act.Params[0]);
break;
case ActionType.ChangeLevel:
player.Level = (byte) act.Params[0];
player.LevelUp();
break;
case ActionType.SetPkPoint:
player.PKPoints = (int) act.Params[0];
break;
case ActionType.ChangeGender:
switch (player.Info.Gender)
{
case MirGender.Male:
player.Info.Gender = MirGender.Female;
break;
case MirGender.Female:
player.Info.Gender = MirGender.Male;
break;
}
break;
case ActionType.ChangeClass:
var data = (MirClass)act.Params[0];
switch (data)
{
case MirClass.Warrior:
player.Info.Class = MirClass.Warrior;
break;
case MirClass.Taoist:
player.Info.Class = MirClass.Taoist;
break;
case MirClass.Wizard:
player.Info.Class = MirClass.Wizard;
break;
case MirClass.Assassin:
player.Info.Class = MirClass.Assassin;
break;
}
break;
case ActionType.LineMessage:
player.ReceiveChat((string)act.Params[0], (ChatType)act.Params[1]);
break;
case ActionType.GiveSkill:
var magic = new UserMagic((Spell)act.Params[0]) { Level = (byte)act.Params[1] };
player.Info.Magics.Add(magic);
player.Enqueue(magic.GetInfo());
break;
case ActionType.Goto:
player.NPCGoto = true;
player.NPCGotoPage = "[" + act.Params[0] + "]";
break;
case ActionType.Set:
player.Info.Flags[(uint) act.Params[0]] = (bool) act.Params[1];
break;
}
}
}